Date: 2016-10-28


In [189]:
%matplotlib inline
%reload_ext autoreload
%autoreload 2
%qtconsole
import sys
import collections
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd

sys.path.append('../src/')
import data_processing
import ripple_decoding
import ripple_detection

In [2]:
Animal = collections.namedtuple('Animal', {'directory', 'short_name'})
num_days = 8
days = range(1, num_days + 1)
animals = {'HPa': Animal(directory='HPa_direct', short_name='HPa')}

epoch_info = data_processing.make_epochs_dataframe(animals, days)
tetrode_info = data_processing.make_tetrode_dataframe(animals)
epoch_index = (epoch_info
    .loc[(['HPa'], [8]), :]
    .loc[epoch_info.environment == 'wtr1'].index)[0]

tetrode_info = data_processing.make_tetrode_dataframe(animals)
area_critera = tetrode_info[epoch_index].area.isin(['CA1', 'CA3']) & \
    ~tetrode_info[epoch_index].descrip.isin(['CA1Ref', 'CA3Ref'])
tetrode_indices = (tetrode_info[epoch_index][area_critera] # Get cell-layer CA1, CA3 LFPs
                       .index.tolist())
CA1_lfps = list(data_processing.get_LFP_data(tetrode_indices, animals).values())

Karlsson method

Method from Karlsson et al. 2009

Test Smooth Envelope


In [64]:
def smoothed_envelope(lfp):
    return pd.DataFrame(
        {'original_signal': lfp.values.flatten(),
         'bandpassed_signal': ripple_detection._ripple_bandpass_filter(lfp.values.flatten()),
         'signal_envelope': ripple_detection._get_envelope(
                ripple_detection._ripple_bandpass_filter(lfp.values.flatten())),
         'smoothed_envelope': ripple_detection._smooth(
                ripple_detection._get_envelope(
                    ripple_detection._ripple_bandpass_filter(lfp.values.flatten())),
                sigma=0.004, sampling_frequency=1500)
        }, index=lfp.index)

filtered_df = smoothed_envelope(CA1_lfps[0])
filtered_df2 = ripple_detection._get_smoothed_envelope(CA1_lfps[0], sigma=0.004, sampling_frequency=1500)

fig, axes = plt.subplots(4, sharex=True, figsize=(12,9))
filtered_df.iloc[0:1500].plot(y='original_signal', ax=axes[0])

filtered_df.iloc[0:1500].plot(y='bandpassed_signal', ax=axes[1])
filtered_df.iloc[0:1500].plot(y='signal_envelope', ax=axes[1])

filtered_df.iloc[0:1500].plot(y='signal_envelope', ax=axes[2])
filtered_df.iloc[0:1500].plot(y='smoothed_envelope', ax=axes[2])

filtered_df.iloc[0:1500].plot(y='smoothed_envelope', ax=axes[3])
filtered_df2.iloc[0:1500].plot(ax=axes[3], linestyle=':')


Out[64]:
<matplotlib.axes._subplots.AxesSubplot at 0x1318024a8>

Test z-scoring and threshold detetction


In [124]:
zscored_lfp = ripple_detection._zscore(filtered_df2).values.flatten()
thresholded_lfp = ripple_detection._threshold_by_zscore(filtered_df2, zscore_threshold=2)
extended_lfp = ripple_detection._extend_threshold_to_mean(
                    thresholded_lfp.is_above_mean,
                    thresholded_lfp.is_above_threshold,
                    minimum_duration=0.015)

fig, axes = plt.subplots(3, figsize=(12,9))
pd.DataFrame({'zscored_signal': zscored_lfp, 
              'is_above_mean': thresholded_lfp.is_above_mean,
              'is_above_threshold': thresholded_lfp.is_above_threshold
             }).iloc[0:1500].plot(ax=axes[0])
axes[0].axhline(2, color='black', linestyle=':')

candidate_ripple_start, candidate_ripple_end = list(sorted(extended_lfp))[0]
pd.DataFrame({'zscored_signal': zscored_lfp, 
              'is_above_mean': thresholded_lfp.is_above_mean,
              'is_above_threshold': thresholded_lfp.is_above_threshold
             }).loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500, :].plot(ax=axes[1])
axes[1].axvspan(candidate_ripple_start, candidate_ripple_end, facecolor='green', alpha=0.3)
axes[1].axhline(2, color='black', linestyle=':')

position_df = data_processing.get_interpolated_position_dataframe(epoch_index, animals)
position_df.loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500, :].plot(y='speed', ax=axes[2])


Out[124]:
<matplotlib.axes._subplots.AxesSubplot at 0x146a6d6d8>

In [17]:
ripple_detection.Karlsson_method(CA1_lfps)


Out[17]:
[(2715.7014666666664, 2715.7681333333335),
 (2717.1614666666665, 2717.2174666666665),
 (2717.6314666666667, 2717.6654666666668),
 (2717.7054666666668, 2717.7554666666665),
 (2717.8261333333335, 2717.8987999999999),
 (2717.9067999999997, 2717.9381333333331),
 (2718.0094666666664, 2718.0834666666665),
 (2718.1474666666668, 2718.1947999999998),
 (2718.4681333333333, 2718.5081333333333),
 (2718.6828, 2718.7447999999999),
 (2718.8314666666665, 2718.9481333333333),
 (2719.0967999999998, 2719.1248000000001),
 (2719.2467999999999, 2719.2768000000001),
 (2719.3034666666667, 2719.3894666666665),
 (2719.8247999999999, 2719.9201333333331),
 (2720.2761333333333, 2720.3734666666664),
 (2720.4061333333334, 2720.4434666666666),
 (2720.6421333333333, 2720.6881333333331),
 (2720.7647999999999, 2720.7974666666664),
 (2721.1274666666668, 2721.1694666666667),
 (2721.2661333333331, 2721.3128000000002),
 (2721.3467999999998, 2721.4288000000001),
 (2721.4367999999999, 2721.5448000000001),
 (2721.5574666666666, 2721.6208000000001),
 (2721.7707999999998, 2721.9894666666664),
 (2721.9901333333332, 2722.1401333333333),
 (2723.3961333333332, 2723.4668000000001),
 (2724.7467999999999, 2724.8107999999997),
 (2724.8854666666666, 2724.9427999999998),
 (2725.1861333333331, 2725.2454666666667),
 (2726.8568, 2726.8821333333331),
 (2726.9548, 2726.9888000000001),
 (2727.0921333333331, 2727.1474666666668),
 (2727.4574666666667, 2727.5221333333334),
 (2728.1841333333332, 2728.2314666666666),
 (2728.5481333333332, 2728.6161333333334),
 (2728.8067999999998, 2728.9201333333331),
 (2729.4007999999999, 2729.4581333333331),
 (2729.4807999999998, 2729.5341333333331),
 (2729.5854666666664, 2729.6534666666666),
 (2729.8647999999998, 2729.9294666666665),
 (2730.1547999999998, 2730.2527999999998),
 (2730.7208000000001, 2730.7794666666664),
 (2730.8494666666666, 2730.9581333333331),
 (2730.9941333333331, 2731.0461333333333),
 (2731.1861333333331, 2731.2667999999999),
 (2731.7821333333331, 2731.8241333333331),
 (2732.6754666666666, 2732.7114666666666),
 (2732.9841333333334, 2733.0361333333331),
 (2733.4421333333335, 2733.4754666666668),
 (2733.9561333333331, 2734.0147999999999),
 (2734.2481333333335, 2734.3301333333334),
 (2734.5448000000001, 2734.6141333333335),
 (2734.6468, 2734.7194666666664),
 (2734.7988, 2734.8528000000001),
 (2734.9034666666666, 2734.9354666666668),
 (2734.9554666666668, 2735.0281333333332),
 (2735.0541333333331, 2735.0974666666666),
 (2735.1241333333332, 2735.2107999999998),
 (2736.1754666666666, 2736.2694666666666),
 (2736.8734666666664, 2736.9627999999998),
 (2737.0254666666665, 2737.0561333333335),
 (2737.1861333333331, 2737.2401333333332),
 (2738.1268, 2738.1694666666667),
 (2738.2507999999998, 2738.2994666666668),
 (2738.3388, 2738.4341333333332),
 (2738.5787999999998, 2738.6314666666667),
 (2738.6367999999998, 2738.7214666666664),
 (2738.7601333333332, 2738.8434666666667),
 (2739.4221333333335, 2739.5361333333331),
 (2739.7254666666668, 2739.7707999999998),
 (2739.8208, 2739.8981333333331),
 (2740.8827999999999, 2740.9181333333331),
 (2741.0321333333331, 2741.1268),
 (2741.1421333333333, 2741.3081333333334),
 (2741.3334666666665, 2741.3788),
 (2741.4714666666664, 2741.5314666666668),
 (2741.5514666666668, 2741.6507999999999),
 (2741.6574666666666, 2741.7721333333334),
 (2741.8141333333333, 2741.9288000000001),
 (2741.9341333333332, 2742.0454666666665),
 (2742.0828000000001, 2742.1241333333332),
 (2742.1321333333331, 2742.3514666666665),
 (2742.6747999999998, 2742.7487999999998),
 (2743.2608, 2743.3521333333333),
 (2743.5187999999998, 2743.5861333333332),
 (2743.8094666666666, 2743.8748000000001),
 (2744.1734666666666, 2744.4381333333331),
 (2744.4481333333333, 2744.6594666666665),
 (2744.7481333333335, 2744.8841333333335),
 (2745.0828000000001, 2745.1194666666665),
 (2745.1307999999999, 2745.1687999999999),
 (2745.2734666666665, 2745.4787999999999),
 (2745.4974666666667, 2745.5934666666667),
 (2745.7748000000001, 2745.8188),
 (2745.8801333333331, 2745.9101333333333),
 (2745.9148, 2745.9888000000001),
 (2748.6681333333331, 2748.7701333333334),
 (2749.3694666666665, 2749.4321333333332),
 (2749.4661333333333, 2749.6894666666667),
 (2750.1414666666665, 2750.1741333333334),
 (2751.0494666666664, 2751.0821333333333),
 (2751.3174666666664, 2751.3794666666668),
 (2751.8221333333331, 2751.8581333333332),
 (2752.8541333333333, 2752.9014666666667),
 (2753.6754666666666, 2753.7208000000001),
 (2753.7254666666668, 2753.7821333333331),
 (2754.9708000000001, 2755.0394666666666),
 (2755.8748000000001, 2755.9374666666668),
 (2756.1941333333334, 2756.2494666666666),
 (2756.2561333333333, 2756.4401333333331),
 (2756.6081333333332, 2756.6741333333334),
 (2756.7347999999997, 2756.7907999999998),
 (2757.1841333333332, 2757.2701333333334),
 (2757.4601333333335, 2757.5981333333334),
 (2757.6547999999998, 2757.7307999999998),
 (2757.7881333333335, 2757.9361333333331),
 (2758.0694666666668, 2758.1114666666667),
 (2758.3328000000001, 2758.3968),
 (2758.4381333333331, 2758.5354666666667),
 (2758.6841333333332, 2758.7721333333334),
 (2758.8981333333331, 2758.9381333333331),
 (2759.0214666666666, 2759.0921333333331),
 (2759.2121333333334, 2759.2507999999998),
 (2760.8154666666665, 2760.8434666666667),
 (2761.5347999999999, 2761.8667999999998),
 (2761.9001333333331, 2762.0594666666666),
 (2763.6334666666667, 2763.6681333333331),
 (2765.7301333333335, 2765.8061333333335),
 (2766.2494666666666, 2766.3214666666668),
 (2766.7341333333334, 2766.7621333333332),
 (2766.8541333333333, 2766.9081333333334),
 (2767.1361333333334, 2767.2154666666665),
 (2767.5181333333335, 2767.5874666666664),
 (2767.5921333333331, 2767.6248000000001),
 (2767.9281333333333, 2768.0954666666667),
 (2768.6274666666668, 2768.7341333333334),
 (2768.7854666666667, 2768.9021333333335),
 (2769.3261333333335, 2769.4401333333331),
 (2769.5061333333333, 2769.5828000000001),
 (2769.9227999999998, 2769.9587999999999),
 (2770.1221333333333, 2770.2154666666665),
 (2770.3314666666665, 2770.4181333333331),
 (2770.4787999999999, 2770.5081333333333),
 (2770.9954666666667, 2771.0708),
 (2771.0754666666667, 2771.1967999999997),
 (2771.2481333333335, 2771.3854666666666),
 (2771.9367999999999, 2772.0007999999998),
 (2772.1867999999999, 2772.2314666666666),
 (2772.8821333333331, 2772.9134666666664),
 (2773.2794666666664, 2773.3381333333332),
 (2773.4047999999998, 2773.4501333333333),
 (2773.6701333333331, 2773.7021333333332),
 (2773.8307999999997, 2773.8768),
 (2775.0814666666665, 2775.1134666666667),
 (2775.2001333333333, 2775.2621333333332),
 (2775.3261333333335, 2775.6221333333333),
 (2775.6434666666664, 2775.7727999999997),
 (2775.7801333333332, 2775.9201333333331),
 (2776.0654666666665, 2776.1841333333332),
 (2776.2614666666668, 2776.3388),
 (2776.5268000000001, 2776.7927999999997),
 (2777.9881333333333, 2778.0314666666668),
 (2778.1408000000001, 2778.2127999999998),
 (2778.7474666666667, 2778.8494666666666),
 (2779.4534666666668, 2779.5121333333332),
 (2779.6687999999999, 2779.7221333333332),
 (2779.8654666666666, 2779.9047999999998),
 (2780.2667999999999, 2780.3314666666665),
 (2780.6301333333331, 2780.6681333333331),
 (2780.6934666666666, 2780.7707999999998),
 (2781.0868, 2781.1941333333334),
 (2781.2874666666667, 2781.4207999999999),
 (2784.3987999999999, 2784.4587999999999),
 (2785.1941333333334, 2785.2681333333335),
 (2785.6028000000001, 2785.6514666666667),
 (2786.5001333333335, 2786.5308),
 (2788.1054666666664, 2788.1374666666666),
 (2788.5981333333334, 2788.6814666666664),
 (2788.7248, 2788.7721333333334),
 (2789.1808000000001, 2789.2094666666667),
 (2789.2841333333331, 2789.3494666666666),
 (2789.5441333333333, 2789.6487999999999),
 (2790.094133333333, 2790.1294666666668),
 (2790.3427999999999, 2790.4288000000001),
 (2790.4361333333331, 2790.4681333333333),
 (2790.5741333333331, 2790.6127999999999),
 (2790.6314666666667, 2790.7467999999999),
 (2791.1514666666667, 2791.2547999999997),
 (2791.3168000000001, 2791.3981333333331),
 (2791.5527999999999, 2791.6074666666668),
 (2792.1081333333332, 2792.1727999999998),
 (2792.344133333333, 2792.4207999999999),
 (2792.6141333333335, 2792.6788000000001),
 (2792.7001333333333, 2792.8381333333332),
 (2793.0068000000001, 2793.0587999999998),
 (2793.0787999999998, 2793.1341333333335),
 (2793.3788, 2793.4467999999997),
 (2793.5101333333332, 2793.5428000000002),
 (2794.1321333333331, 2794.1774666666665),
 (2794.2667999999999, 2794.3394666666668),
 (2795.9921333333332, 2796.0754666666667),
 (2796.4427999999998, 2796.5128),
 (2796.6707999999999, 2796.6947999999998),
 (2797.3708000000001, 2797.4201333333331),
 (2799.2194666666664, 2799.3201333333332),
 (2803.8708000000001, 2803.9094666666665),
 (2804.4947999999999, 2804.5514666666668),
 (2804.594133333333, 2804.7174666666665),
 (2804.9587999999999, 2805.0007999999998),
 (2805.0694666666668, 2805.1028000000001),
 (2805.1401333333333, 2805.2487999999998),
 (2805.5481333333332, 2805.5961333333335),
 (2805.7467999999999, 2805.7828),
 (2805.9888000000001, 2806.0587999999998),
 (2806.2074666666667, 2806.3281333333334),
 (2806.5308, 2806.5934666666667),
 (2806.8434666666667, 2806.8948),
 (2807.2354666666665, 2807.3114666666665),
 (2807.3921333333333, 2807.4187999999999),
 (2807.4801333333335, 2807.5334666666668),
 (2808.0321333333331, 2808.0688),
 (2808.2327999999998, 2808.2867999999999),
 (2808.4148, 2808.4908),
 (2808.5714666666668, 2808.6687999999999),
 (2808.9607999999998, 2809.0448000000001),
 (2809.4034666666666, 2809.4681333333333),
 (2809.4827999999998, 2809.5121333333332),
 (2809.9207999999999, 2810.0241333333333),
 (2810.2514666666666, 2810.3201333333332),
 (2815.1914666666667, 2815.2254666666668),
 (2815.5708, 2815.6234666666664),
 (2815.7041333333332, 2815.7454666666667),
 (2815.7954666666665, 2815.8241333333331),
 (2816.0021333333334, 2816.0294666666664),
 (2816.2507999999998, 2816.3341333333333),
 (2816.4354666666668, 2816.4681333333333),
 (2818.4121333333333, 2818.4567999999999),
 (2818.4874666666665, 2818.5521333333331),
 (2818.5561333333335, 2818.6008000000002),
 (2818.8168000000001, 2818.8701333333333),
 (2818.9801333333335, 2819.0508),
 (2821.2721333333334, 2821.3294666666666),
 (2821.3447999999999, 2821.4748),
 (2821.5034666666666, 2821.6268),
 (2821.6661333333332, 2821.7441333333331),
 (2821.7487999999998, 2822.0068000000001),
 (2822.1767999999997, 2822.3348000000001),
 (2822.8041333333331, 2822.844133333333),
 (2823.2981333333332, 2823.3368),
 (2823.5374666666667, 2823.5727999999999),
 (2823.7994666666664, 2823.8641333333335),
 (2823.9241333333334, 2824.0394666666666),
 (2824.4214666666667, 2824.4807999999998),
 (2824.6754666666666, 2824.7314666666666),
 (2825.0121333333332, 2825.0721333333331),
 (2825.7781333333332, 2825.8087999999998),
 (2825.9194666666667, 2826.0361333333331),
 (2828.3881333333334, 2828.4168),
 (2829.0281333333332, 2829.1161333333334),
 (2830.5614666666665, 2830.6341333333335),
 (2831.1408000000001, 2831.1967999999997),
 (2831.4974666666667, 2831.5981333333334),
 (2831.6641333333332, 2831.7368000000001),
 (2831.7581333333333, 2831.8201333333332),
 (2831.8607999999999, 2831.9567999999999),
 (2831.9874666666665, 2832.0207999999998),
 (2832.2714666666666, 2832.3034666666667),
 (2832.8334666666665, 2832.8874666666666),
 (2832.9341333333332, 2833.0174666666667),
 (2833.0767999999998, 2833.1468),
 (2833.2074666666667, 2833.2974666666664),
 (2833.3188, 2833.5554666666667),
 (2833.7234666666668, 2833.7968000000001),
 (2834.2441333333331, 2834.3254666666667),
 (2834.5261333333333, 2834.6101333333331),
 (2834.9374666666668, 2834.9827999999998),
 (2835.3961333333332, 2835.4601333333335),
 (2835.7681333333335, 2835.8134666666665),
 (2837.4121333333333, 2837.5054666666665),
 (2837.5721333333331, 2837.6048000000001),
 (2837.8594666666668, 2837.9088000000002),
 (2837.9221333333335, 2837.9847999999997),
 (2838.0701333333332, 2838.1074666666668),
 (2838.1194666666665, 2838.1901333333331),
 (2838.2141333333334, 2838.3674666666666),
 (2838.3708000000001, 2838.4581333333331),
 (2838.4874666666665, 2838.5281333333332),
 (2838.7647999999999, 2838.7988),
 (2838.8141333333333, 2838.8721333333333),
 (2838.9108000000001, 2838.9834666666666),
 (2839.0794666666666, 2839.1947999999998),
 (2839.2001333333333, 2839.5361333333331),
 (2839.6461333333332, 2839.6881333333331),
 (2839.7041333333332, 2839.8388),
 (2839.8447999999999, 2839.8827999999999),
 (2839.8881333333334, 2840.0268000000001),
 (2840.0367999999999, 2840.2467999999999),
 (2840.3134666666665, 2840.3474666666666),
 (2840.4421333333335, 2840.5034666666666),
 (2840.5454666666665, 2840.7421333333332),
 (2840.7547999999997, 2841.1181333333334),
 (2841.1541333333334, 2841.2261333333331),
 (2841.3881333333334, 2841.4174666666668),
 (2841.4767999999999, 2841.5754666666667),
 (2841.7201333333333, 2841.8261333333335),
 (2842.0081333333333, 2842.0954666666667),
 (2842.1734666666666, 2842.2034666666668),
 (2842.4161333333332, 2842.4494666666665),
 (2842.8687999999997, 2842.9474666666665),
 (2845.5901333333331, 2845.6248000000001),
 (2846.1461333333332, 2846.2501333333335),
 (2847.9921333333332, 2848.0654666666665),
 (2848.1668, 2848.2041333333332),
 (2848.8581333333332, 2848.8874666666666),
 (2849.0227999999997, 2849.0521333333331),
 (2849.5781333333334, 2849.6301333333331),
 (2851.1781333333333, 2851.2281333333331),
 (2851.3568, 2851.4708000000001),
 (2851.4861333333333, 2851.5147999999999),
 (2851.6801333333333, 2851.7408),
 (2852.6934666666666, 2852.7841333333331),
 (2852.8581333333332, 2852.9481333333333),
 (2853.1514666666667, 2853.2254666666668),
 (2853.4708000000001, 2853.5161333333331),
 (2853.6394666666665, 2853.6854666666668),
 (2853.7041333333332, 2853.8061333333335),
 (2853.8247999999999, 2853.9607999999998),
 (2853.9801333333335, 2854.0214666666666),
 (2854.0581333333334, 2854.1974666666665),
 (2854.8334666666665, 2854.8661333333334),
 (2855.0714666666668, 2855.1374666666666),
 (2855.2001333333333, 2855.2841333333331),
 (2856.5308, 2856.6147999999998),
 (2856.8474666666666, 2856.8968),
 (2856.9488000000001, 2856.9987999999998),
 (2857.3694666666665, 2857.4214666666667),
 (2857.4281333333333, 2857.6081333333332),
 (2857.6567999999997, 2857.7621333333332),
 (2859.2527999999998, 2859.2861333333331),
 (2859.3821333333331, 2859.4987999999998),
 (2859.7181333333333, 2859.7447999999999),
 (2859.7521333333334, 2859.8761333333332),
 (2859.9554666666668, 2860.0108),
 (2860.0367999999999, 2860.1401333333333),
 (2860.4334666666664, 2860.4841333333334),
 (2860.9108000000001, 2861.0021333333334),
 (2863.1927999999998, 2863.2307999999998),
 (2865.0134666666668, 2865.1021333333333),
 (2865.7494666666666, 2865.7828),
 (2866.0874666666668, 2866.1354666666666),
 (2866.210133333333, 2866.2788),
 (2866.3494666666666, 2866.4267999999997),
 (2866.4488000000001, 2866.4794666666667),
 (2866.5861333333332, 2866.6781333333333),
 (2866.7674666666667, 2866.8254666666667),
 (2866.9161333333332, 2866.9661333333333),
 (2867.4701333333333, 2867.6954666666666),
 (2867.7428, 2867.7961333333333),
 (2867.8934666666664, 2867.9627999999998),
 (2870.0221333333334, 2870.0594666666666),
 (2870.8908000000001, 2870.9394666666667),
 (2871.1874666666668, 2871.2641333333331),
 (2871.5987999999998, 2871.6641333333332),
 (2872.0248000000001, 2872.1061333333332),
 (2872.1154666666666, 2872.2861333333331),
 (2872.3227999999999, 2872.3987999999999),
 (2872.7561333333333, 2872.8227999999999),
 (2873.1774666666665, 2873.2788),
 (2873.4521333333332, 2873.5034666666666),
 (2873.6248000000001, 2873.7014666666664),
 (2874.5134666666668, 2874.6048000000001),
 (2874.6854666666668, 2874.7441333333331),
 (2875.3421333333331, 2875.4274666666665),
 (2876.1208000000001, 2876.1534666666666),
 (2876.5448000000001, 2876.6334666666667),
 (2878.1054666666664, 2878.1674666666668),
 (2878.6161333333334, 2878.6947999999998),
 (2881.5601333333334, 2881.6527999999998),
 (2882.2941333333333, 2882.3601333333331),
 (2885.9774666666667, 2886.0094666666664),
 (2886.2447999999999, 2886.3161333333333),
 (2887.1387999999997, 2887.2314666666666),
 (2887.3381333333332, 2887.3948),
 (2888.9781333333331, 2889.0207999999998),
 (2889.1661333333332, 2889.2481333333335),
 (2889.5261333333333, 2889.6374666666666),
 (2889.8321333333333, 2889.8968),
 (2889.9688000000001, 2890.0474666666664),
 (2890.0927999999999, 2890.1927999999998),
 (2890.3534666666665, 2890.4314666666664),
 (2890.4888000000001, 2890.5747999999999),
 (2890.6181333333334, 2890.6867999999999),
 (2890.9767999999999, 2891.0248000000001),
 (2891.0508, 2891.0814666666665),
 (2891.5868, 2891.6648),
 (2892.1028000000001, 2892.1881333333331),
 (2892.3594666666668, 2892.4334666666664),
 (2892.8181333333332, 2892.8687999999997),
 (2892.9261333333334, 2893.0521333333331),
 (2893.4321333333332, 2893.4827999999998),
 (2894.9081333333334, 2894.9767999999999),
 (2895.0367999999999, 2895.1021333333333),
 (2895.1641333333332, 2895.2141333333334),
 (2895.8127999999997, 2895.8514666666665),
 (2897.7554666666665, 2897.7841333333331),
 (2900.1414666666665, 2900.2208000000001),
 (2900.4928, 2900.5174666666667),
 (2900.6707999999999, 2900.8407999999999),
 (2902.1687999999999, 2902.2061333333331),
 (2902.3348000000001, 2902.402133333333),
 (2902.4361333333331, 2902.4914666666664),
 (2902.8934666666664, 2903.0161333333331),
 (2903.1907999999999, 2903.2314666666666),
 (2903.7061333333331, 2903.7654666666667),
 (2903.9108000000001, 2903.9421333333335),
 (2904.7874666666667, 2904.8208),
 (2904.8774666666668, 2904.9187999999999),
 (2905.1887999999999, 2905.3148000000001),
 (2905.710133333333, 2905.7461333333331),
 (2905.7774666666664, 2905.8754666666664),
 (2905.9234666666666, 2906.0374666666667),
 (2906.0807999999997, 2906.152133333333),
 (2906.1927999999998, 2906.2354666666665),
 (2907.0141333333331, 2907.1094666666668),
 (2907.1834666666664, 2907.2808),
 (2907.3981333333331, 2907.4861333333333),
 (2907.8407999999999, 2907.8827999999999),
 (2908.3687999999997, 2908.4668000000001),
 (2908.4761333333331, 2908.5727999999999),
 (2908.6828, 2908.8314666666665),
 (2909.0254666666665, 2909.1041333333333),
 (2909.3121333333333, 2909.3541333333333),
 (2909.7087999999999, 2909.7788),
 (2909.8141333333333, 2909.8548000000001),
 (2909.8614666666667, 2909.9328),
 (2913.1321333333331, 2913.1774666666665),
 (2914.8621333333331, 2914.9501333333333),
 (2915.2714666666666, 2915.3794666666668),
 (2915.4447999999998, 2915.5201333333334),
 (2915.5288, 2915.5881333333332),
 (2915.9441333333334, 2916.0601333333334),
 (2916.7087999999999, 2916.8174666666664),
 (2917.0014666666666, 2917.0807999999997),
 (2917.0907999999999, 2917.1181333333334),
 (2917.5241333333333, 2917.5574666666666),
 (2918.0648000000001, 2918.1408000000001),
 (2918.2534666666666, 2918.3974666666668),
 (2918.5888, 2918.7114666666666),
 (2918.9901333333332, 2919.0607999999997),
 (2919.5347999999999, 2919.5781333333334),
 (2919.6241333333332, 2919.7454666666667),
 (2923.6721333333335, 2923.7054666666668),
 (2923.8901333333333, 2923.9427999999998),
 (2924.0954666666667, 2924.1661333333332),
 (2924.3101333333334, 2924.4541333333332),
 (2924.4734666666668, 2924.5627999999997),
 (2924.7721333333334, 2924.8941333333332),
 (2925.3867999999998, 2925.4441333333334),
 (2925.9967999999999, 2926.1021333333333),
 (2927.3067999999998, 2927.3607999999999),
 (2927.5308, 2927.5627999999997),
 (2927.6461333333332, 2927.7054666666668),
 (2927.7168000000001, 2927.7794666666664),
 (2927.9181333333331, 2927.9728),
 (2928.3287999999998, 2928.3794666666668),
 (2928.6714666666667, 2928.7208000000001),
 (2933.1248000000001, 2933.1581333333334),
 (2933.2028, 2933.2968000000001),
 (2933.6327999999999, 2933.7774666666664),
 (2934.0054666666665, 2934.0848000000001),
 (2934.3981333333331, 2934.4607999999998),
 (2934.4654666666665, 2934.5347999999999),
 (2934.5708, 2934.6107999999999),
 (2934.6354666666666, 2934.6694666666667),
 (2934.6854666666668, 2934.7654666666667),
 (2934.7768000000001, 2934.8427999999999),
 (2934.8601333333331, 2934.9014666666667),
 (2934.9827999999998, 2935.0108),
 (2935.3054666666667, 2935.4081333333334),
 (2935.4541333333332, 2935.6608000000001),
 (2935.7234666666668, 2935.8161333333333),
 (2935.9254666666666, 2935.9814666666666),
 (2936.0061333333333, 2936.0374666666667),
 (2936.1154666666666, 2936.2287999999999),
 (2936.3101333333334, 2936.4074666666666),
 (2936.4528, 2936.5108),
 (2938.0254666666665, 2938.0694666666668),
 (2938.2527999999998, 2938.3148000000001),
 (2938.3634666666667, 2938.5128),
 (2938.8634666666667, 2938.9194666666667),
 (2939.6834666666664, 2939.7254666666668),
 (2942.4574666666667, 2942.5054666666665),
 (2942.6147999999998, 2942.6821333333332),
 (2944.0627999999997, 2944.2134666666666),
 (2944.3407999999999, 2944.3934666666664),
 (2944.5347999999999, 2944.5648000000001),
 (2945.7701333333334, 2945.8061333333335),
 (2946.6501333333331, 2946.7307999999998),
 (2947.3381333333332, 2947.3807999999999),
 (2947.7454666666667, 2947.8121333333333),
 (2950.3467999999998, 2950.3981333333331),
 (2950.7994666666664, 2950.8621333333331),
 (2951.5888, 2951.6214666666665),
 (2952.9994666666666, 2953.0274666666664),
 (2953.3721333333333, 2953.4294666666665),
 (2953.5094666666664, 2953.5654666666665),
 (2953.8101333333334, 2953.8667999999998),
 (2954.0641333333333, 2954.0954666666667),
 (2954.2621333333332, 2954.3067999999998),
 (2954.5994666666666, 2954.6981333333333),
 (2955.6761333333334, 2955.7194666666664),
 (2955.7814666666668, 2955.8321333333333),
 (2956.4367999999999, 2956.4994666666666),
 (2956.5974666666666, 2956.6608000000001),
 (2956.7067999999999, 2956.7694666666666),
 (2956.9168, 2956.9928),
 (2957.9321333333332, 2958.0227999999997),
 (2958.7588000000001, 2958.8267999999998),
 (2959.1574666666666, 2959.3227999999999),
 (2959.4748, 2959.5547999999999),
 (2960.3368, 2960.4354666666668),
 (2960.5134666666668, 2960.5694666666668),
 (2960.5934666666667, 2960.6761333333334),
 (2960.7074666666667, 2960.7667999999999),
 (2960.8594666666668, 2960.9001333333331),
 (2960.9834666666666, 2961.0234666666665),
 (2961.0901333333331, 2961.1394666666665),
 (2961.3261333333335, 2961.4234666666666),
 (2961.5074666666665, 2961.5688),
 (2961.9114666666665, 2961.9427999999998),
 (2962.0101333333332, 2962.0488),
 (2963.4694666666664, 2963.5594666666666),
 (2964.7901333333334, 2964.8341333333333),
 (2964.9041333333334, 2964.9348),
 (2965.2114666666666, 2965.3267999999998),
 (2965.5774666666666, 2965.6228000000001),
 (2965.7834666666668, 2965.8361333333332),
 (2966.3621333333331, 2966.4294666666665),
 (2966.4901333333332, 2966.5767999999998),
 (2966.6187999999997, 2966.7121333333334),
 (2966.7541333333334, 2966.8561333333332),
 (2966.9261333333334, 2966.9554666666668),
 (2967.0421333333334, 2967.0754666666667),
 (2967.6061333333332, 2967.7154666666665),
 (2967.8601333333331, 2967.9854666666665),
 (2968.8368, 2968.8627999999999),
 (2970.3107999999997, 2970.3568),
 (2970.4841333333334, 2970.5334666666668),
 (2970.9174666666668, 2970.9534666666668),
 (2971.5428000000002, 2971.6028000000001),
 (2972.0108, 2972.0454666666665),
 (2972.0888, 2972.1641333333332),
 (2972.2501333333335, 2972.4041333333334),
 (2972.4467999999997, 2972.4994666666666),
 (2972.6801333333333, 2972.9014666666667),
 (2973.1841333333332, 2973.2801333333332),
 (2979.9741333333332, 2980.0021333333334),
 (2981.0294666666668, 2981.0727999999999),
 (2981.2748000000001, 2981.3414666666667),
 (2981.7501333333335, 2981.8274666666666),
 (2982.2501333333335, 2982.2934666666665),
 (2982.3467999999998, 2982.4168),
 (2983.9187999999999, 2984.0254666666665),
 (2984.2474666666667, 2984.2761333333333),
 (2985.6221333333333, 2985.6494666666667),
 (2988.4554666666668, 2988.4888000000001),
 (2988.5801333333334, 2988.7034666666668),
 (2989.0361333333331, 2989.1048000000001),
 (2990.3274666666666, 2990.3667999999998),
 (2991.1127999999999, 2991.1588000000002),
 (2991.3881333333334, 2991.4328),
 (2991.7774666666664, 2991.8781333333332),
 (2992.0294666666668, 2992.0807999999997),
 (2992.0921333333331, 2992.1347999999998),
 (2992.5468000000001, 2992.6008000000002),
 (2992.7261333333331, 2992.8047999999999),
 (2992.884133333333, 2992.9514666666664),
 (2993.0308, 2993.0581333333334),
 (2993.0641333333333, 2993.2028),
 (2993.3021333333331, 2993.3901333333333),
 (2993.4094666666665, 2993.4967999999999),
 (2993.5661333333333, 2993.6201333333333),
 (2994.0301333333332, 2994.0701333333332),
 (2994.1828, 2994.2634666666668),
 (2994.7768000000001, 2994.8314666666665),
 (2995.2274666666667, 2995.3454666666667),
 (2995.3667999999998, 2995.4501333333333),
 (2995.5554666666667, 2995.6248000000001),
 (2995.6701333333331, 2995.7894666666666),
 (2995.9354666666668, 2996.0654666666665),
 (2996.2208000000001, 2996.2614666666668),
 (2996.634133333333, 2996.6701333333331),
 (2996.8768, 2996.9174666666668),
 (2997.0428000000002, 2997.1414666666665),
 (3000.9148, 3001.1454666666668),
 (3002.1907999999999, 3002.2208000000001),
 (3003.2694666666666, 3003.3214666666668),
 (3004.9794666666667, 3005.0621333333333),
 (3005.1361333333334, 3005.1921333333335),
 (3008.0554666666667, 3008.1414666666665),
 (3008.7461333333331, 3008.8348000000001),
 (3008.8354666666664, 3008.9234666666666),
 (3009.0461333333333, 3009.0914666666667),
 (3009.4548, 3009.7188000000001),
 (3009.7307999999998, 3009.8661333333334),
 (3010.0167999999999, 3010.0594666666666),
 (3010.1614666666665, 3010.2307999999998),
 (3010.3328000000001, 3010.3914666666665),
 (3010.4261333333334, 3010.6421333333333),
 (3011.1474666666668, 3011.2727999999997),
 (3011.3081333333334, 3011.4027999999998),
 (3011.4427999999998, 3011.4961333333331),
 (3011.6028000000001, 3011.6707999999999),
 (3011.8914666666665, 3012.0094666666664),
 (3012.0154666666667, 3012.0927999999999),
 (3012.1567999999997, 3012.1941333333334),
 (3012.2028, 3012.2521333333334),
 (3012.2974666666664, 3012.4754666666668),
 (3012.5494666666664, 3012.6261333333332),
 (3012.6327999999999, 3012.8154666666665),
 (3012.9054666666666, 3012.9781333333331),
 (3012.9801333333335, 3013.0727999999999),
 (3013.2234666666664, 3013.2534666666666),
 (3013.6281333333332, 3013.6661333333332),
 (3015.5121333333332, 3015.5527999999999),
 (3018.6648, 3018.7754666666665),
 (3018.9461333333334, 3019.0807999999997),
 (3019.4761333333331, 3019.5254666666665),
 (3019.7507999999998, 3019.7828),
 (3019.7961333333333, 3019.8267999999998),
 (3020.2941333333333, 3020.3794666666668),
 (3020.402133333333, 3020.4541333333332),
 (3020.8501333333334, 3020.8774666666668),
 (3020.9514666666664, 3021.0494666666664),
 (3021.1181333333334, 3021.2221333333332),
 (3021.2761333333333, 3021.4268000000002),
 (3021.4567999999999, 3021.5041333333334),
 (3021.6081333333332, 3021.7788),
 (3021.8061333333335, 3021.8968),
 (3021.9914666666664, 3022.0314666666663),
 (3022.1228000000001, 3022.1974666666665),
 (3022.2388000000001, 3022.3234666666667),
 (3022.3627999999999, 3022.4787999999999),
 (3022.4861333333333, 3022.6174666666666),
 (3024.1428000000001, 3024.1727999999998),
 (3024.2041333333332, 3024.3961333333332),
 (3025.1441333333332, 3025.2261333333331),
 (3025.8701333333333, 3025.9441333333334),
 (3026.1028000000001, 3026.1954666666666),
 (3026.4941333333331, 3026.5301333333332),
 (3026.5734666666667, 3026.6588000000002),
 (3026.8514666666665, 3026.9108000000001),
 (3027.0974666666666, 3027.1501333333331),
 (3030.4281333333333, 3030.4634666666666),
 (3030.6461333333332, 3030.6974666666665),
 (3030.7354666666665, 3030.826133333333),
 (3031.8941333333332, 3031.9521333333332),
 (3033.2881333333335, 3033.3561333333332),
 (3033.4461333333334, 3033.4874666666665),
 (3034.1461333333332, 3034.2194666666664),
 (3034.3114666666665, 3034.3874666666666),
 (3035.7521333333334, 3035.7781333333332),
 (3036.0281333333332, 3036.0561333333335),
 (3037.0641333333333, 3037.1201333333333),
 (3037.1461333333332, 3037.2841333333331),
 (3037.6661333333332, 3037.7414666666664),
 (3037.8047999999999, 3037.8954666666668),
 (3037.9054666666666, 3038.0088000000001),
 (3038.0187999999998, 3038.1421333333333),
 (3038.1694666666667, 3038.2847999999999),
 (3038.3254666666667, 3038.4134666666664),
 (3038.4328, 3038.5407999999998),
 (3039.0514666666668, 3039.0854666666664),
 (3039.1974666666665, 3039.2527999999998),
 (3039.6954666666666, 3039.7727999999997),
 (3040.4688000000001, 3040.4961333333331),
 (3040.7754666666665, 3040.8694666666665),
 (3041.1768000000002, 3041.2348000000002),
 (3041.4534666666668, 3041.4941333333331),
 (3044.7421333333332, 3044.8148000000001),
 (3045.6848, 3045.7221333333332),
 (3045.8474666666666, 3045.8768),
 (3046.9654666666665, 3047.0047999999997),
 (3048.9767999999999, 3049.0147999999999),
 (3051.3634666666667, 3051.402133333333),
 (3051.4981333333335, 3051.5361333333331),
 (3051.9314666666664, 3051.9647999999997),
 (3052.4441333333334, 3052.5561333333335),
 (3052.6421333333333, 3052.6781333333333),
 (3054.0661333333333, 3054.1234666666664),
 (3054.9767999999999, 3055.0367999999999),
 (3055.2694666666666, 3055.3227999999999),
 (3055.3348000000001, 3055.3721333333333),
 (3056.2988, 3056.3481333333334),
 (3056.8467999999998, 3056.9187999999999),
 (3057.2388000000001, 3057.2694666666666),
 (3057.2794666666668, 3057.3101333333334),
 (3057.4034666666666, 3057.4754666666668),
 (3057.9294666666665, 3058.0347999999999),
 (3058.1901333333335, 3058.2994666666664),
 (3058.4921333333332, 3058.5521333333331),
 (3058.5947999999999, 3058.6621333333333),
 (3058.7354666666665, 3058.7614666666668),
 (3059.3287999999998, 3059.4101333333333),
 (3059.5574666666666, 3059.5828000000001),
 (3059.6641333333332, 3059.7381333333333),
 (3059.9541333333332, 3059.9821333333334),
 (3060.0214666666666, 3060.0814666666665),
 (3060.0821333333333, 3060.1487999999999),
 (3060.5681333333332, 3060.6861333333331),
 (3060.7274666666667, 3060.7614666666668),
 (3061.0141333333331, 3061.0441333333333),
 (3061.2494666666666, 3061.3341333333333),
 (3061.9521333333332, 3062.0094666666664),
 (3062.3461333333335, 3062.3741333333332),
 (3064.2734666666665, 3064.4414666666667),
 (3065.9508000000001, 3065.9901333333332),
 (3066.2481333333335, 3066.3141333333333),
 (3066.7774666666664, 3066.8127999999997),
 (3066.8594666666668, 3066.9721333333332),
 (3067.0494666666664, 3067.1187999999997),
 (3067.1854666666668, 3067.2608),
 (3067.3894666666665, 3067.4381333333331),
 (3067.4627999999998, 3067.4994666666666),
 (3067.5701333333332, 3067.7487999999998),
 (3067.7594666666664, 3067.8061333333335),
 (3068.0914666666667, 3068.2194666666664),
 (3068.2574666666665, 3068.3087999999998),
 (3068.768133333333, 3068.8027999999999),
 (3069.3508000000002, 3069.3867999999998),
 (3069.6874666666668, 3069.7954666666665),
 (3069.9634666666666, 3070.0708),
 (3070.1507999999999, 3070.1841333333332),
 (3070.3681333333334, 3070.4661333333333),
 (3070.4941333333331, 3070.5668000000001),
 (3070.7801333333332, 3070.8581333333332),
 (3071.1588000000002, 3071.2494666666666),
 (3071.4027999999998, 3071.5088000000001),
 (3071.5194666666666, 3071.6008000000002),
 (3074.5041333333334, 3074.5607999999997),
 (3074.7034666666668, 3074.7894666666666),
 (3075.7034666666668, 3075.8781333333332),
 (3076.3754666666664, 3076.4081333333334),
 (3076.7507999999998, 3076.8734666666664),
 (3077.3494666666666, 3077.4108000000001),
 (3078.5521333333331, 3078.6394666666665),
 (3078.7314666666666, 3078.7654666666667),
 (3079.0428000000002, 3079.0727999999999),
 (3079.5781333333334, 3079.6801333333333),
 (3079.7228, 3079.7761333333333),
 (3079.9088000000002, 3080.0308),
 (3080.0574666666666, 3080.1494666666667),
 (3080.3654666666666, 3080.4354666666668),
 (3080.4627999999998, 3080.5128),
 (3080.5821333333333, 3080.7147999999997),
 (3080.7581333333333, 3080.8961333333332),
 (3080.9328, 3080.9961333333331),
 (3081.0674666666664, 3081.1381333333334),
 (3081.1781333333333, 3081.2294666666667),
 (3081.2487999999998, 3081.3034666666667),
 (3081.4521333333332, 3081.4794666666667),
 (3081.9227999999998, 3081.9694666666664),
 (3082.7907999999998, 3082.8481333333334),
 (3082.9961333333331, 3083.0607999999997),
 (3083.3781333333332, 3083.4621333333334),
 (3084.2001333333333, 3084.2334666666666),
 (3087.8814666666667, 3087.9387999999999),
 (3088.1801333333333, 3088.2628),
 (3088.5961333333335, 3088.6294666666668),
 (3089.5907999999999, 3089.6181333333334),
 (3089.6214666666665, 3089.6567999999997),
 (3090.2507999999998, 3090.3368),
 (3090.4361333333331, 3090.4721333333332),
 (3090.5514666666668, 3090.6327999999999),
 (3090.8681333333334, 3090.9054666666666),
 (3090.9134666666664, 3090.9827999999998),
 (3091.2634666666668, 3091.3894666666665),
 (3091.7881333333335, 3091.9061333333334),
 (3092.2541333333334, 3092.2954666666665),
 (3092.7614666666668, 3092.8061333333335),
 (3093.2461333333331, 3093.2948000000001),
 (3093.3294666666666, 3093.3627999999999),
 (3093.5861333333332, 3093.6387999999997),
 (3093.6727999999998, 3093.7327999999998),
 (3093.9241333333334, 3093.9894666666664),
 (3094.4041333333334, 3094.4441333333334),
 (3094.4934666666668, 3094.5654666666665),
 (3094.5821333333333, 3094.6334666666667),
 (3095.4488000000001, 3095.4954666666667),
 (3100.2734666666665, 3100.3561333333332),
 (3100.4281333333333, 3100.5714666666668),
 (3101.2701333333334, 3101.3241333333331),
 (3101.6701333333331, 3101.7394666666664),
 (3102.6608000000001, 3102.7327999999998),
 (3103.1927999999998, 3103.2401333333332),
 (3103.2614666666668, 3103.3127999999997),
 (3103.4341333333332, 3103.5501333333332),
 (3104.1288, 3104.1727999999998),
 (3104.1914666666667, 3104.2354666666665),
 (3104.3994666666667, 3104.4294666666665),
 (3104.5207999999998, 3104.5747999999999),
 (3104.9287999999997, 3104.9794666666667),
 (3105.5634666666665, 3105.6174666666666),
 (3105.6401333333333, 3105.8214666666668),
 (3105.9161333333332, 3105.9654666666665),
 (3106.1714666666667, 3106.2481333333335),
 (3106.5027999999998, 3106.5607999999997),
 (3106.8481333333334, 3106.8788),
 (3107.0434666666665, 3107.0834666666665),
 (3107.4161333333332, 3107.4754666666668),
 (3107.5574666666666, 3107.6127999999999),
 (3107.6861333333331, 3107.7307999999998),
 (3107.9814666666666, 3108.1081333333332),
 (3108.1161333333334, 3108.1474666666668),
 (3108.5668000000001, 3108.6001333333334),
 (3108.7687999999998, 3108.8827999999999),
 (3108.8941333333332, 3108.9467999999997),
 (3111.9614666666666, 3112.1961333333334),
 (3113.2134666666666, 3113.2981333333332),
 (3114.4054666666666, 3114.4574666666667),
 (3114.5147999999999, 3114.5821333333333),
 (3115.0594666666666, 3115.1268),
 (3115.4481333333333, 3115.5294666666668),
 (3115.6687999999999, 3115.7274666666667),
 (3115.7474666666667, 3115.8081333333334),
 (3116.1954666666666, 3116.3014666666668),
 (3116.3368, 3116.4334666666664),
 (3116.4854666666665, 3116.5981333333334),
 (3116.6767999999997, 3116.7087999999999),
 (3116.8714666666665, 3116.9108000000001),
 (3117.0468000000001, 3117.0888),
 (3118.0894666666663, 3118.1907999999999),
 (3119.1428000000001, 3119.1701333333331),
 (3119.4154666666664, 3119.4934666666668),
 (3119.5328, 3119.5634666666665),
 (3119.9647999999997, 3120.0514666666668),
 (3120.1668, 3120.2914666666666),
 (3120.6501333333331, 3120.7527999999998),
 (3120.7974666666664, 3120.8227999999999),
 (3121.1354666666666, 3121.1754666666666),
 (3121.2001333333333, 3121.3134666666665),
 (3121.3267999999998, 3121.3714666666665),
 (3121.5301333333332, 3121.5661333333333),
 (3121.7854666666667, 3121.8534666666665),
 (3121.8714666666665, 3121.9954666666667),
 (3122.3574666666664, 3122.3981333333331),
 (3122.5021333333334, 3122.5441333333333),
 (3125.4634666666666, 3125.6101333333331),
 (3126.1774666666665, 3126.2121333333334),
 (3127.9047999999998, 3127.9541333333332),
 (3128.1574666666666, 3128.2008000000001),
 (3128.3061333333335, 3128.3968),
 (3128.7341333333334, 3128.7794666666668),
 (3128.8854666666666, 3128.9401333333335),
 (3129.3374666666668, 3129.4661333333333),
 (3130.0401333333334, 3130.0814666666665),
 (3130.3321333333333, 3130.3854666666666),
 (3130.8114666666665, 3130.8941333333332),
 (3130.9361333333331, 3131.1001333333334),
 (3131.1054666666664, 3131.2234666666664),
 (3131.5414666666666, 3131.6628000000001),
 (3131.7301333333335, 3131.7561333333333),
 (3131.9708000000001, 3132.0321333333331),
 (3132.6321333333335, 3132.6727999999998),
 (3133.3794666666668, 3133.4267999999997),
 (3133.7941333333333, 3133.8621333333331),
 (3134.3581333333332, 3134.5641333333333),
 (3134.6434666666664, 3134.6774666666665),
 (3135.2734666666665, 3135.3847999999998),
 (3135.4607999999998, 3135.6147999999998),
 (3135.6228000000001, 3135.6547999999998),
 (3135.8734666666664, 3135.9414666666667),
 (3135.9641333333334, 3135.9954666666667),
 (3136.1654666666664, 3136.2121333333334),
 (3136.2334666666666, 3136.2834666666668),
 (3136.5394666666666, 3136.6147999999998),
 (3136.6701333333331, 3136.7361333333333),
 (3136.7634666666668, 3136.8681333333334),
 (3137.0501333333332, 3137.0834666666665),
 (3137.1414666666665, 3137.2114666666666),
 (3137.4508000000001, 3137.4987999999998),
 (3137.9281333333333, 3137.9548),
 (3137.9741333333332, 3138.0134666666668),
 (3138.0961333333335, 3138.1414666666665),
 (3138.4721333333332, 3138.5054666666665),
 (3139.5648000000001, 3139.5981333333334),
 (3140.1921333333335, 3140.2988),
 (3140.3087999999998, 3140.3521333333333),
 (3140.3714666666665, 3140.4194666666667),
 (3140.4367999999999, 3140.4914666666664),
 (3141.7828, 3141.8568),
 (3142.3928000000001, 3142.4301333333333),
 (3142.6314666666667, 3142.6707999999999),
 (3142.710133333333, 3142.7554666666665),
 (3142.9174666666668, 3142.960133333333),
 (3142.9787999999999, 3143.0708),
 (3146.2421333333332, 3146.2788),
 (3147.8807999999999, 3147.960133333333),
 (3148.0314666666663, 3148.0641333333333),
 (3148.0947999999999, 3148.1674666666668),
 (3148.5254666666665, 3148.5708),
 (3149.2487999999998, 3149.2928000000002),
 (3154.0481333333332, 3154.0794666666666),
 (3154.2441333333331, 3154.3181333333332),
 (3154.3914666666665, 3154.4434666666666),
 (3154.5554666666667, 3154.6988000000001),
 (3154.7701333333334, 3154.8334666666665),
 (3154.8487999999998, 3154.9361333333331),
 (3155.2248, 3155.2861333333331),
 (3155.5461333333333, 3155.6588000000002),
 (3155.6721333333335, 3155.7894666666666),
 (3155.8234666666667, 3155.9181333333331),
 (3156.1567999999997, 3156.2188000000001),
 (3156.2814666666663, 3156.3407999999999),
 (3157.5101333333332, 3157.6021333333333),
 (3157.6434666666664, 3157.6701333333331),
 (3157.6961333333334, 3157.7654666666667),
 (3157.7921333333334, 3157.8474666666666),
 (3158.0794666666666, 3158.2008000000001),
 (3158.2287999999999, 3158.2727999999997),
 (3158.7421333333332, 3158.8221333333331),
 (3158.8874666666666, 3159.0167999999999),
 (3159.2428, 3159.2867999999999),
 (3159.4874666666665, 3159.5734666666667),
 (3160.0454666666665, 3160.094133333333),
 (3160.1181333333334, 3160.1594666666665),
 (3160.3701333333333, 3160.4067999999997),
 (3161.3514666666665, 3161.4187999999999),
 (3161.6814666666664, 3161.7341333333334),
 (3163.1974666666665, 3163.2374666666665),
 (3165.4668000000001, 3165.5194666666666),
 (3165.5828000000001, 3165.6301333333331),
 (3166.3594666666668, 3166.4054666666666),
 (3166.5114666666668, 3166.5921333333331),
 (3167.1674666666668, 3167.2467999999999),
 (3167.5207999999998, 3167.5587999999998),
 (3167.6381333333334, 3167.6907999999999),
 (3168.5614666666665, 3168.5947999999999),
 (3169.6701333333331, 3169.7048),
 (3170.7321333333334, 3170.7741333333333),
 (3171.4548, 3171.5508),
 (3171.5947999999999, 3171.6241333333332),
 (3171.8374666666668, 3171.9247999999998),
 (3172.1461333333332, 3172.1741333333334),
 (3172.1774666666665, 3172.2028),
 (3172.2514666666666, 3172.3014666666668),
 (3172.3188, 3172.4014666666667),
 (3172.5614666666665, 3172.6028000000001),
 (3172.9548, 3173.0494666666664),
 (3173.9201333333331, 3173.9874666666665),
 (3174.3328000000001, 3174.3887999999997),
 (3174.7194666666664, 3174.8161333333333),
 (3174.8647999999998, 3174.9748),
 (3175.0374666666667, 3175.1154666666666),
 (3175.3434666666667, 3175.3874666666666),
 (3175.6821333333332, 3175.7248),
 (3175.7454666666667, 3175.8201333333332),
 (3176.0828000000001, 3176.1121333333331),
 (3176.2048, 3176.2954666666665),
 (3176.4041333333334, 3176.4587999999999),
 (3176.6414666666665, 3176.6714666666667),
 (3176.7588000000001, 3176.8614666666667),
 (3177.7221333333332, 3177.7527999999998),
 (3180.2881333333335, 3180.3301333333334),
 (3182.2028, 3182.2487999999998),
 (3182.4348, 3182.4954666666667),
 (3184.0061333333333, 3184.0541333333331),
 (3184.9108000000001, 3184.9567999999999),
 (3185.134133333333, 3185.1674666666668),
 (3185.5627999999997, 3185.6201333333333),
 (3185.6347999999998, 3185.6707999999999),
 (3185.7894666666666, 3185.8654666666666),
 (3186.1274666666668, 3186.1588000000002),
 (3186.2847999999999, 3186.3407999999999),
 (3186.3501333333334, 3186.4194666666667),
 (3186.4967999999999, 3186.5367999999999),
 (3186.7594666666664, 3186.8247999999999),
 (3186.8667999999998, 3186.9848000000002),
 (3187.0334666666668, 3187.0967999999998),
 (3187.1274666666668, 3187.2208000000001),
 (3187.2321333333334, 3187.2628),
 (3187.2974666666664, 3187.4007999999999),
 (3187.9161333333332, 3187.9634666666666),
 (3188.5614666666665, 3188.6107999999999),
 (3188.6654666666664, 3188.7248),
 (3188.8247999999999, 3188.8514666666665),
 (3189.1734666666666, 3189.2261333333331),
 (3189.5794666666666, 3189.6654666666664),
 (3189.7154666666665, 3189.7734666666665),
 (3190.0334666666668, 3190.0828000000001),
 (3190.8281333333334, 3190.8887999999997),
 (3190.942133333333, 3191.0587999999998),
 (3191.1081333333332, 3191.2174666666665),
 (3191.2394666666664, 3191.4394666666667),
 (3191.4947999999999, 3191.576133333333),
 (3191.7701333333334, 3191.8728000000001),
 (3191.8961333333332, 3191.942133333333),
 (3192.3101333333334, 3192.344133333333),
 (3192.4607999999998, 3192.5308),
 ...]

In [131]:
ripple_detection._exclude_movement_during_ripples(ripple_detection.Karlsson_method(CA1_lfps),
                                                  epoch_index, animals, 4)


Out[131]:
[(2723.3961333333332, 2723.4668000000001),
 (2726.8568, 2726.8821333333331),
 (2726.9548, 2726.9888000000001),
 (2731.7821333333331, 2731.8241333333331),
 (2743.2608, 2743.3521333333333),
 (2751.0494666666664, 2751.0821333333333),
 (2751.3174666666664, 2751.3794666666668),
 (2751.8221333333331, 2751.8581333333332),
 (2752.8541333333333, 2752.9014666666667),
 (2753.6754666666666, 2753.7208000000001),
 (2753.7254666666668, 2753.7821333333331),
 (2754.9708000000001, 2755.0394666666666),
 (2758.6841333333332, 2758.7721333333334),
 (2758.8981333333331, 2758.9381333333331),
 (2759.0214666666666, 2759.0921333333331),
 (2760.8154666666665, 2760.8434666666667),
 (2763.6334666666667, 2763.6681333333331),
 (2765.7301333333335, 2765.8061333333335),
 (2766.2494666666666, 2766.3214666666668),
 (2766.7341333333334, 2766.7621333333332),
 (2766.8541333333333, 2766.9081333333334),
 (2767.1361333333334, 2767.2154666666665),
 (2770.9954666666667, 2771.0708),
 (2771.0754666666667, 2771.1967999999997),
 (2771.2481333333335, 2771.3854666666666),
 (2773.6701333333331, 2773.7021333333332),
 (2773.8307999999997, 2773.8768),
 (2784.3987999999999, 2784.4587999999999),
 (2785.1941333333334, 2785.2681333333335),
 (2785.6028000000001, 2785.6514666666667),
 (2786.5001333333335, 2786.5308),
 (2788.1054666666664, 2788.1374666666666),
 (2788.5981333333334, 2788.6814666666664),
 (2795.9921333333332, 2796.0754666666667),
 (2796.4427999999998, 2796.5128),
 (2796.6707999999999, 2796.6947999999998),
 (2797.3708000000001, 2797.4201333333331),
 (2799.2194666666664, 2799.3201333333332),
 (2828.3881333333334, 2828.4168),
 (2829.0281333333332, 2829.1161333333334),
 (2830.5614666666665, 2830.6341333333335),
 (2834.9374666666668, 2834.9827999999998),
 (2835.3961333333332, 2835.4601333333335),
 (2835.7681333333335, 2835.8134666666665),
 (2845.5901333333331, 2845.6248000000001),
 (2846.1461333333332, 2846.2501333333335),
 (2847.9921333333332, 2848.0654666666665),
 (2848.1668, 2848.2041333333332),
 (2848.8581333333332, 2848.8874666666666),
 (2849.0227999999997, 2849.0521333333331),
 (2849.5781333333334, 2849.6301333333331),
 (2855.0714666666668, 2855.1374666666666),
 (2855.2001333333333, 2855.2841333333331),
 (2856.5308, 2856.6147999999998),
 (2863.1927999999998, 2863.2307999999998),
 (2870.0221333333334, 2870.0594666666666),
 (2878.1054666666664, 2878.1674666666668),
 (2878.6161333333334, 2878.6947999999998),
 (2885.9774666666667, 2886.0094666666664),
 (2886.2447999999999, 2886.3161333333333),
 (2887.1387999999997, 2887.2314666666666),
 (2887.3381333333332, 2887.3948),
 (2894.9081333333334, 2894.9767999999999),
 (2895.0367999999999, 2895.1021333333333),
 (2895.1641333333332, 2895.2141333333334),
 (2900.1414666666665, 2900.2208000000001),
 (2900.4928, 2900.5174666666667),
 (2900.6707999999999, 2900.8407999999999),
 (2913.1321333333331, 2913.1774666666665),
 (2914.8621333333331, 2914.9501333333333),
 (2915.2714666666666, 2915.3794666666668),
 (2915.4447999999998, 2915.5201333333334),
 (2915.5288, 2915.5881333333332),
 (2939.6834666666664, 2939.7254666666668),
 (2942.4574666666667, 2942.5054666666665),
 (2942.6147999999998, 2942.6821333333332),
 (2944.0627999999997, 2944.2134666666666),
 (2944.3407999999999, 2944.3934666666664),
 (2944.5347999999999, 2944.5648000000001),
 (2945.7701333333334, 2945.8061333333335),
 (2946.6501333333331, 2946.7307999999998),
 (2947.3381333333332, 2947.3807999999999),
 (2947.7454666666667, 2947.8121333333333),
 (2950.3467999999998, 2950.3981333333331),
 (2950.7994666666664, 2950.8621333333331),
 (2951.5888, 2951.6214666666665),
 (2952.9994666666666, 2953.0274666666664),
 (2953.3721333333333, 2953.4294666666665),
 (2953.5094666666664, 2953.5654666666665),
 (2953.8101333333334, 2953.8667999999998),
 (2954.0641333333333, 2954.0954666666667),
 (2954.2621333333332, 2954.3067999999998),
 (2954.5994666666666, 2954.6981333333333),
 (2955.6761333333334, 2955.7194666666664),
 (2955.7814666666668, 2955.8321333333333),
 (2956.4367999999999, 2956.4994666666666),
 (2956.5974666666666, 2956.6608000000001),
 (2956.7067999999999, 2956.7694666666666),
 (2956.9168, 2956.9928),
 (2957.9321333333332, 2958.0227999999997),
 (2979.9741333333332, 2980.0021333333334),
 (2981.0294666666668, 2981.0727999999999),
 (2981.2748000000001, 2981.3414666666667),
 (2981.7501333333335, 2981.8274666666666),
 (2982.2501333333335, 2982.2934666666665),
 (2982.3467999999998, 2982.4168),
 (2983.9187999999999, 2984.0254666666665),
 (2984.2474666666667, 2984.2761333333333),
 (2985.6221333333333, 2985.6494666666667),
 (2990.3274666666666, 2990.3667999999998),
 (3000.9148, 3001.1454666666668),
 (3002.1907999999999, 3002.2208000000001),
 (3004.9794666666667, 3005.0621333333333),
 (3005.1361333333334, 3005.1921333333335),
 (3015.5121333333332, 3015.5527999999999),
 (3030.4281333333333, 3030.4634666666666),
 (3030.6461333333332, 3030.6974666666665),
 (3030.7354666666665, 3030.826133333333),
 (3033.2881333333335, 3033.3561333333332),
 (3033.4461333333334, 3033.4874666666665),
 (3034.1461333333332, 3034.2194666666664),
 (3034.3114666666665, 3034.3874666666666),
 (3044.7421333333332, 3044.8148000000001),
 (3046.9654666666665, 3047.0047999999997),
 (3048.9767999999999, 3049.0147999999999),
 (3064.2734666666665, 3064.4414666666667),
 (3074.5041333333334, 3074.5607999999997),
 (3074.7034666666668, 3074.7894666666666),
 (3075.7034666666668, 3075.8781333333332),
 (3076.3754666666664, 3076.4081333333334),
 (3100.2734666666665, 3100.3561333333332),
 (3100.4281333333333, 3100.5714666666668),
 (3101.2701333333334, 3101.3241333333331),
 (3111.9614666666666, 3112.1961333333334),
 (3113.2134666666666, 3113.2981333333332),
 (3133.3794666666668, 3133.4267999999997),
 (3133.7941333333333, 3133.8621333333331),
 (3134.3581333333332, 3134.5641333333333),
 (3134.6434666666664, 3134.6774666666665),
 (3163.1974666666665, 3163.2374666666665),
 (3165.4668000000001, 3165.5194666666666),
 (3165.5828000000001, 3165.6301333333331),
 (3166.3594666666668, 3166.4054666666666),
 (3166.5114666666668, 3166.5921333333331),
 (3167.1674666666668, 3167.2467999999999),
 (3167.5207999999998, 3167.5587999999998),
 (3167.6381333333334, 3167.6907999999999),
 (3168.5614666666665, 3168.5947999999999),
 (3180.2881333333335, 3180.3301333333334),
 (3195.4708000000001, 3195.5227999999997),
 (3195.9941333333331, 3196.0721333333331),
 (3196.0801333333334, 3196.1988000000001),
 (3196.2534666666666, 3196.2887999999998),
 (3210.2261333333331, 3210.2907999999998),
 (3217.1094666666668, 3217.1661333333332),
 (3218.3501333333334, 3218.4061333333334),
 (3218.5494666666664, 3218.6694666666667),
 (3218.8101333333334, 3218.9647999999997),
 (3219.0914666666667, 3219.1567999999997),
 (3219.3634666666667, 3219.3981333333331),
 (3219.4441333333334, 3219.5007999999998),
 (3220.9714666666664, 3221.0954666666667),
 (3223.5734666666667, 3223.6114666666667),
 (3225.2327999999998, 3225.3621333333331),
 (3225.4301333333333, 3225.4854666666665),
 (3236.0014666666666, 3236.1154666666666),
 (3237.0281333333332, 3237.1194666666665),
 (3238.1814666666664, 3238.2228),
 (3238.4974666666667, 3238.5281333333332),
 (3239.2581333333333, 3239.3114666666665),
 (3240.6601333333333, 3240.7074666666667),
 (3256.6967999999997, 3256.7421333333332),
 (3256.7941333333333, 3257.0681333333332),
 (3268.4621333333334, 3268.5654666666665),
 (3270.9787999999999, 3271.0614666666665),
 (3272.2634666666663, 3272.3321333333333),
 (3282.4287999999997, 3282.4827999999998),
 (3282.7828, 3282.8174666666664),
 (3282.8368, 3282.8681333333334),
 (3293.1874666666668, 3293.2414666666664),
 (3293.3807999999999, 3293.4427999999998),
 (3296.5601333333334, 3296.6641333333332),
 (3297.4674666666665, 3297.5174666666667),
 (3305.0921333333331, 3305.1808000000001),
 (3306.6081333333332, 3306.6527999999998),
 (3306.8108000000002, 3306.8974666666663),
 (3312.7481333333335, 3312.8067999999998),
 (3312.8948, 3313.0027999999998),
 (3314.1981333333333, 3314.2521333333334),
 (3314.4387999999999, 3314.4721333333332),
 (3314.7154666666665, 3314.7614666666668),
 (3315.8934666666664, 3315.9974666666667),
 (3328.0561333333335, 3328.1494666666667),
 (3340.3108000000002, 3340.3688000000002),
 (3353.7647999999999, 3353.8434666666667),
 (3359.9694666666664, 3360.1228000000001),
 (3360.2467999999999, 3360.2734666666665),
 (3360.6321333333335, 3360.6547999999998),
 (3360.8734666666664, 3360.9234666666666),
 (3361.0254666666665, 3361.0614666666665),
 (3361.3087999999998, 3361.4148),
 (3362.7861333333331, 3362.9034666666666),
 (3363.6961333333334, 3363.7461333333331),
 (3364.0994666666666, 3364.1848),
 (3365.3247999999999, 3365.3681333333334),
 (3377.6581333333334, 3377.7127999999998),
 (3378.0234666666665, 3378.0508),
 (3378.1808000000001, 3378.2734666666665),
 (3378.3807999999999, 3378.4541333333332),
 (3378.6654666666664, 3378.7154666666665),
 (3387.634133333333, 3387.6654666666664),
 (3389.5854666666664, 3389.9081333333334),
 (3390.9134666666669, 3391.0201333333334),
 (3391.3561333333332, 3391.4041333333334),
 (3409.9694666666664, 3410.0541333333331),
 (3410.8914666666665, 3410.9294666666665),
 (3411.0407999999998, 3411.1054666666664),
 (3412.7174666666665, 3412.8114666666665),
 (3418.7507999999998, 3418.8254666666667),
 (3425.0634666666665, 3425.1581333333334),
 (3425.8688000000002, 3425.9134666666669),
 (3426.0201333333334, 3426.0608000000002),
 (3426.0694666666668, 3426.2294666666667),
 (3426.7961333333333, 3426.8527999999997),
 (3427.0987999999998, 3427.192133333333),
 (3427.6734666666666, 3427.7234666666664),
 (3428.0141333333331, 3428.1334666666667),
 (3428.1494666666667, 3428.2608),
 (3434.0114666666668, 3434.058133333333),
 (3434.1088, 3434.1601333333333),
 (3434.3301333333334, 3434.3788),
 (3435.1174666666666, 3435.1648),
 (3436.3614666666667, 3436.4074666666666),
 (3436.9934666666668, 3437.0441333333333),
 (3437.1361333333334, 3437.2348000000002),
 (3437.4694666666664, 3437.5848000000001),
 (3445.2788, 3445.3654666666666),
 (3451.2774666666664, 3451.3274666666666),
 (3458.0088000000001, 3458.1101333333331),
 (3470.7974666666664, 3470.8421333333331),
 (3472.2574666666665, 3472.3221333333331),
 (3472.3941333333332, 3472.4674666666665),
 (3475.1474666666663, 3475.1901333333335),
 (3476.2547999999997, 3476.3027999999999),
 (3476.384133333333, 3476.4154666666664),
 (3478.4041333333334, 3478.4354666666668),
 (3478.8541333333333, 3478.9074666666666),
 (3516.2467999999999, 3516.3568),
 (3530.6367999999998, 3530.7161333333333),
 (3531.6734666666666, 3531.7801333333332),
 (3531.8614666666667, 3531.9467999999997),
 (3535.3881333333334, 3535.4301333333333),
 (3536.8294666666666, 3536.8781333333332),
 (3537.1621333333333, 3537.1994666666665),
 (3537.3481333333334, 3537.4514666666664),
 (3538.0747999999999, 3538.1147999999998),
 (3538.1561333333334, 3538.2228),
 (3538.558133333333, 3538.6054666666664),
 (3541.7187999999996, 3541.7914666666666),
 (3545.8481333333334, 3545.9014666666667),
 (3545.9061333333334, 3545.960133333333),
 (3548.5274666666664, 3548.5554666666667),
 (3563.1654666666664, 3563.1934666666666),
 (3564.1494666666667, 3564.2114666666666),
 (3578.0587999999998, 3578.1074666666664),
 (3578.7847999999999, 3578.8281333333334),
 (3578.9207999999999, 3578.9974666666667),
 (3579.4074666666666, 3579.500133333333),
 (3585.6294666666663, 3585.6914666666667),
 (3585.7554666666665, 3585.9061333333334),
 (3585.9614666666666, 3586.0101333333332),
 (3586.0901333333331, 3586.1281333333332),
 (3597.8548000000001, 3597.8887999999997),
 (3598.5134666666663, 3598.5627999999997),
 (3599.4128000000001, 3599.4694666666664),
 (3611.6687999999999, 3611.7574666666665),
 (3611.7628, 3611.8101333333334),
 (3611.8407999999999, 3611.9827999999998),
 (3612.9447999999998, 3612.9987999999998),
 (3613.0441333333333, 3613.1154666666666),
 (3614.6327999999999, 3614.6714666666667),
 (3614.7527999999998, 3614.8447999999999),
 (3615.9541333333332, 3615.9874666666665),
 (3616.1841333333332, 3616.2094666666667),
 (3627.1841333333332, 3627.2334666666666),
 (3627.7974666666664, 3627.8721333333333),
 (3628.3254666666667, 3628.3807999999999),
 (3628.4107999999997, 3628.5194666666666),
 (3629.2687999999998, 3629.3554666666664),
 (3629.4101333333333, 3629.6514666666667),
 (3641.5267999999996, 3641.5688),
 (3641.7534666666666, 3641.8314666666665),
 (3641.924133333333, 3641.9714666666669),
 (3642.4287999999997, 3642.4994666666666),
 (3642.7381333333333, 3642.7841333333331),
 (3642.8934666666664, 3642.9954666666667),
 (3643.2988, 3643.3908000000001),
 (3643.9074666666666, 3643.9434666666666),
 (3653.5161333333331, 3653.634133333333),
 (3653.6394666666665, 3653.7287999999999),
 (3653.732133333333, 3653.7821333333331),
 (3654.7941333333333, 3654.8474666666666),
 (3654.8861333333334, 3655.1581333333334),
 (3656.0868, 3656.1188000000002),
 (3660.9841333333334, 3661.0574666666666),
 (3661.7447999999999, 3661.7968000000001),
 (3662.8394666666663, 3662.9301333333333),
 (3671.7281333333331, 3671.8054666666667),
 (3676.9987999999998, 3677.0674666666664),
 (3677.9181333333331, 3677.9501333333333),
 (3678.3301333333334, 3678.3748000000001),
 (3679.1507999999999, 3679.1841333333332),
 (3687.7614666666668, 3687.8141333333333),
 (3688.1588000000002, 3688.3688000000002),
 (3688.5461333333333, 3688.5987999999998),
 (3689.1828, 3689.2274666666667),
 (3689.3274666666666, 3689.3607999999999),
 (3689.4488000000001, 3689.5587999999998),
 (3689.8647999999998, 3689.9394666666667),
 (3691.0914666666667, 3691.2267999999999),
 (3704.1828, 3704.2154666666665),
 (3704.9121333333333, 3704.9494666666665),
 (3705.0194666666666, 3705.0874666666668),
 (3705.9407999999999, 3705.9728),
 (3706.2574666666665, 3706.3214666666663),
 (3707.8594666666668, 3707.9214666666667),
 (3708.4994666666666, 3708.5474666666664),
 (3721.3114666666665, 3721.4141333333332),
 (3721.4268000000002, 3721.6127999999999),
 (3721.6554666666666, 3721.7701333333334),
 (3736.3254666666667, 3736.5081333333333),
 (3736.6088, 3736.6821333333332),
 (3736.8554666666664, 3736.9107999999997),
 (3737.5288, 3737.5807999999997),
 (3738.9628000000002, 3739.0534666666663),
 (3739.1167999999998, 3739.1867999999999),
 (3739.7107999999998, 3739.7461333333331),
 (3740.4554666666663, 3740.4928),
 (3740.6721333333335, 3740.6988000000001),
 (3740.7094666666667, 3740.7661333333335),
 (3740.7774666666664, 3740.8148000000001),
 (3741.4587999999999, 3741.5381333333335),
 (3742.5414666666666, 3742.5927999999999),
 (3743.1487999999999, 3743.2294666666667),
 (3743.6848, 3743.7428),
 (3754.1381333333329, 3754.2401333333332),
 (3754.2847999999999, 3754.3548000000001),
 (3755.8141333333333, 3755.9528),
 (3755.9794666666667, 3756.0154666666667),
 (3756.1301333333331, 3756.1714666666667),
 (3757.8474666666666, 3757.9454666666666),
 (3763.5927999999999, 3763.6487999999999),
 (3763.7221333333332, 3763.7534666666666),
 (3764.0347999999999, 3764.0834666666665),
 (3764.3514666666665, 3764.4561333333331),
 (3772.9168, 3772.9541333333332),
 (3774.1254666666664, 3774.290133333333),
 (3784.3247999999999, 3784.3881333333329),
 (3784.9321333333332, 3784.982133333333),
 (3785.6141333333335, 3785.6628000000001),
 (3785.8188, 3785.8861333333334),
 (3796.6514666666662, 3796.6774666666665),
 (3798.1361333333334, 3798.1734666666666),
 (3798.7241333333332, 3798.7808),
 (3798.8334666666665, 3798.9047999999998),
 (3800.2554666666665, 3800.2941333333333),
 (3800.3647999999998, 3800.4668000000001),
 (3801.6254666666664, 3801.6801333333333),
 (3802.7461333333331, 3802.8208),
 (3803.0741333333335, 3803.1314666666667),
 (3812.8761333333332, 3812.9141333333332),
 (3814.1107999999999, 3814.1954666666666),
 (3814.3681333333334, 3814.4327999999996),
 (3814.6234666666669, 3814.6894666666667),
 (3815.0667999999996, 3815.1188000000002),
 (3815.1994666666665, 3815.3074666666666),
 (3815.3288000000002, 3815.4268000000002),
 (3825.3901333333333, 3825.4174666666668),
 (3827.1294666666663, 3827.1861333333331),
 (3827.7201333333333, 3827.7994666666664),
 (3828.4301333333333, 3828.4848000000002),
 (3828.4974666666667, 3828.5601333333334),
 (3829.9881333333333, 3830.0634666666665),
 (3830.3634666666667, 3830.4721333333332),
 (3830.7361333333333, 3830.7788),
 (3830.9227999999998, 3830.9587999999999),
 (3830.9974666666667, 3831.0281333333332),
 (3832.0141333333331, 3832.0821333333333),
 (3832.4501333333333, 3832.6114666666663),
 (3832.8394666666663, 3832.8788),
 (3833.2014666666664, 3833.2694666666666),
 (3833.3981333333331, 3833.4387999999999),
 (3833.5694666666668, 3833.6581333333334),
 (3833.8534666666665, 3833.8941333333332),
 (3833.9621333333334, 3834.0487999999996),
 (3834.3401333333331, 3834.3881333333329),
 (3834.9274666666665, 3834.9567999999999),
 (3835.4814666666666, 3835.5108),
 (3835.5208000000002, 3835.6101333333331),
 (3835.6808000000001, 3835.7767999999996),
 (3836.3141333333333, 3836.3694666666665),
 (3837.1768000000002, 3837.2727999999997),
 (3837.3948, 3837.4214666666667),
 (3837.5734666666667, 3837.6114666666663),
 (3837.8494666666666, 3837.8941333333332),
 (3846.7274666666663, 3846.8427999999999),
 (3847.3454666666667, 3847.4027999999998),
 (3847.4507999999996, 3847.5047999999997),
 (3847.5434666666665, 3847.5874666666668),
 (3848.7594666666664, 3848.8208),
 (3848.9807999999998, 3849.1234666666669),
 (3849.1774666666665, 3849.2547999999997),
 (3850.7041333333332, 3850.7907999999998),
 (3861.2774666666664, 3861.3647999999998),
 (3861.4621333333334, 3861.5648000000001),
 (3870.6787999999997, 3870.7568000000001),
 (3870.7941333333333, 3870.8807999999999),
 (3871.3067999999998, 3871.3948),
 (3872.5308, 3872.558133333333),
 (3874.3927999999996, 3874.4541333333332),
 (3875.7801333333332, 3875.8134666666665),
 (3875.8761333333332, 3875.9628000000002),
 (3876.1781333333333, 3876.2228),
 (3876.4867999999997, 3876.5141333333331),
 (3876.5547999999999, 3876.5907999999999),
 (3878.9054666666666, 3878.9327999999996),
 (3879.9327999999996, 3880.0708),
 (3880.9407999999999, 3880.9754666666668),
 (3881.6768000000002, 3881.7421333333332),
 (3882.0101333333332, 3882.1014666666665),
 (3882.1914666666667, 3882.2781333333332),
 (3884.4327999999996, 3884.4841333333334),
 (3884.6701333333331, 3884.7034666666668),
 (3886.5227999999997, 3886.5574666666666),
 (3887.3341333333333, 3887.3807999999999),
 (3888.3854666666666, 3888.424133333333),
 (3888.5201333333334, 3888.6094666666668),
 (3889.4007999999999, 3889.4481333333333),
 (3889.6841333333332, 3889.7161333333333),
 (3890.4748, 3890.5381333333335),
 (3891.0834666666665, 3891.1441333333332),
 (3892.1188000000002, 3892.2341333333334),
 (3892.3754666666664, 3892.4574666666667),
 (3892.8101333333334, 3892.8908000000001),
 (3893.5034666666666, 3893.5608000000002),
 (3896.2921333333334, 3896.3494666666666),
 (3903.692133333333, 3903.8254666666667),
 (3903.9234666666666, 3903.9881333333333),
 (3904.5134666666663, 3904.5907999999999),
 (3904.7687999999998, 3904.8508000000002),
 (3904.9474666666665, 3905.018133333333),
 (3905.2721333333329, 3905.3981333333331),
 (3906.4088000000002, 3906.4774666666663),
 (3906.5208000000002, 3906.5841333333333),
 (3906.924133333333, 3906.9894666666669),
 (3907.2048, 3907.3987999999999),
 (3907.5921333333335, 3907.6421333333333),
 (3907.9627999999998, 3908.0561333333335),
 (3908.9094666666665, 3909.0421333333334),
 (3909.0567999999998, 3909.1081333333332),
 (3909.3627999999999, 3909.3987999999999),
 (3910.7087999999999, 3910.7641333333331),
 (3911.0788000000002, 3911.1194666666665),
 (3911.1507999999999, 3911.2401333333332),
 (3911.7001333333333, 3911.7394666666669),
 (3913.2261333333336, 3913.2828),
 (3913.5347999999999, 3913.6048000000001),
 (3913.6707999999999, 3913.7388000000001),
 (3918.5667999999996, 3918.6154666666666),
 (3919.1041333333333, 3919.1448),
 (3919.2221333333332, 3919.2561333333333)]

In [132]:
ripple_times = ripple_detection.get_epoch_ripples(epoch_index, animals, sampling_frequency=1500,
                                   ripple_detection_function=ripple_detection.Karlsson_method)
ripple_times


Out[132]:
[(2723.3961333333332, 2723.4668000000001),
 (2726.8568, 2726.8821333333331),
 (2726.9548, 2726.9888000000001),
 (2731.7821333333331, 2731.8241333333331),
 (2743.2608, 2743.3521333333333),
 (2751.0494666666664, 2751.0821333333333),
 (2751.3174666666664, 2751.3794666666668),
 (2751.8221333333331, 2751.8581333333332),
 (2752.8541333333333, 2752.9014666666667),
 (2753.6754666666666, 2753.7208000000001),
 (2753.7254666666668, 2753.7821333333331),
 (2754.9708000000001, 2755.0394666666666),
 (2758.6841333333332, 2758.7721333333334),
 (2758.8981333333331, 2758.9381333333331),
 (2759.0214666666666, 2759.0921333333331),
 (2760.8154666666665, 2760.8434666666667),
 (2763.6334666666667, 2763.6681333333331),
 (2765.7301333333335, 2765.8061333333335),
 (2766.2494666666666, 2766.3214666666668),
 (2766.7341333333334, 2766.7621333333332),
 (2766.8541333333333, 2766.9081333333334),
 (2767.1361333333334, 2767.2154666666665),
 (2770.9954666666667, 2771.0708),
 (2771.0754666666667, 2771.1967999999997),
 (2771.2481333333335, 2771.3854666666666),
 (2773.6701333333331, 2773.7021333333332),
 (2773.8307999999997, 2773.8768),
 (2784.3987999999999, 2784.4587999999999),
 (2785.1941333333334, 2785.2681333333335),
 (2785.6028000000001, 2785.6514666666667),
 (2786.5001333333335, 2786.5308),
 (2788.1054666666664, 2788.1374666666666),
 (2788.5981333333334, 2788.6814666666664),
 (2795.9921333333332, 2796.0754666666667),
 (2796.4427999999998, 2796.5128),
 (2796.6707999999999, 2796.6947999999998),
 (2797.3708000000001, 2797.4201333333331),
 (2799.2194666666664, 2799.3201333333332),
 (2828.3881333333334, 2828.4168),
 (2829.0281333333332, 2829.1161333333334),
 (2830.5614666666665, 2830.6341333333335),
 (2834.9374666666668, 2834.9827999999998),
 (2835.3961333333332, 2835.4601333333335),
 (2835.7681333333335, 2835.8134666666665),
 (2845.5901333333331, 2845.6248000000001),
 (2846.1461333333332, 2846.2501333333335),
 (2847.9921333333332, 2848.0654666666665),
 (2848.1668, 2848.2041333333332),
 (2848.8581333333332, 2848.8874666666666),
 (2849.0227999999997, 2849.0521333333331),
 (2849.5781333333334, 2849.6301333333331),
 (2855.0714666666668, 2855.1374666666666),
 (2855.2001333333333, 2855.2841333333331),
 (2856.5308, 2856.6147999999998),
 (2863.1927999999998, 2863.2307999999998),
 (2870.0221333333334, 2870.0594666666666),
 (2878.1054666666664, 2878.1674666666668),
 (2878.6161333333334, 2878.6947999999998),
 (2885.9774666666667, 2886.0094666666664),
 (2886.2447999999999, 2886.3161333333333),
 (2887.1387999999997, 2887.2314666666666),
 (2887.3381333333332, 2887.3948),
 (2894.9081333333334, 2894.9767999999999),
 (2895.0367999999999, 2895.1021333333333),
 (2895.1641333333332, 2895.2141333333334),
 (2900.1414666666665, 2900.2208000000001),
 (2900.4928, 2900.5174666666667),
 (2900.6707999999999, 2900.8407999999999),
 (2913.1321333333331, 2913.1774666666665),
 (2914.8621333333331, 2914.9501333333333),
 (2915.2714666666666, 2915.3794666666668),
 (2915.4447999999998, 2915.5201333333334),
 (2915.5288, 2915.5881333333332),
 (2939.6834666666664, 2939.7254666666668),
 (2942.4574666666667, 2942.5054666666665),
 (2942.6147999999998, 2942.6821333333332),
 (2944.0627999999997, 2944.2134666666666),
 (2944.3407999999999, 2944.3934666666664),
 (2944.5347999999999, 2944.5648000000001),
 (2945.7701333333334, 2945.8061333333335),
 (2946.6501333333331, 2946.7307999999998),
 (2947.3381333333332, 2947.3807999999999),
 (2947.7454666666667, 2947.8121333333333),
 (2950.3467999999998, 2950.3981333333331),
 (2950.7994666666664, 2950.8621333333331),
 (2951.5888, 2951.6214666666665),
 (2952.9994666666666, 2953.0274666666664),
 (2953.3721333333333, 2953.4294666666665),
 (2953.5094666666664, 2953.5654666666665),
 (2953.8101333333334, 2953.8667999999998),
 (2954.0641333333333, 2954.0954666666667),
 (2954.2621333333332, 2954.3067999999998),
 (2954.5994666666666, 2954.6981333333333),
 (2955.6761333333334, 2955.7194666666664),
 (2955.7814666666668, 2955.8321333333333),
 (2956.4367999999999, 2956.4994666666666),
 (2956.5974666666666, 2956.6608000000001),
 (2956.7067999999999, 2956.7694666666666),
 (2956.9168, 2956.9928),
 (2957.9321333333332, 2958.0227999999997),
 (2979.9741333333332, 2980.0021333333334),
 (2981.0294666666668, 2981.0727999999999),
 (2981.2748000000001, 2981.3414666666667),
 (2981.7501333333335, 2981.8274666666666),
 (2982.2501333333335, 2982.2934666666665),
 (2982.3467999999998, 2982.4168),
 (2983.9187999999999, 2984.0254666666665),
 (2984.2474666666667, 2984.2761333333333),
 (2985.6221333333333, 2985.6494666666667),
 (2990.3274666666666, 2990.3667999999998),
 (3000.9148, 3001.1454666666668),
 (3002.1907999999999, 3002.2208000000001),
 (3004.9794666666667, 3005.0621333333333),
 (3005.1361333333334, 3005.1921333333335),
 (3015.5121333333332, 3015.5527999999999),
 (3030.4281333333333, 3030.4634666666666),
 (3030.6461333333332, 3030.6974666666665),
 (3030.7354666666665, 3030.826133333333),
 (3033.2881333333335, 3033.3561333333332),
 (3033.4461333333334, 3033.4874666666665),
 (3034.1461333333332, 3034.2194666666664),
 (3034.3114666666665, 3034.3874666666666),
 (3044.7421333333332, 3044.8148000000001),
 (3046.9654666666665, 3047.0047999999997),
 (3048.9767999999999, 3049.0147999999999),
 (3064.2734666666665, 3064.4414666666667),
 (3074.5041333333334, 3074.5607999999997),
 (3074.7034666666668, 3074.7894666666666),
 (3075.7034666666668, 3075.8781333333332),
 (3076.3754666666664, 3076.4081333333334),
 (3100.2734666666665, 3100.3561333333332),
 (3100.4281333333333, 3100.5714666666668),
 (3101.2701333333334, 3101.3241333333331),
 (3111.9614666666666, 3112.1961333333334),
 (3113.2134666666666, 3113.2981333333332),
 (3133.3794666666668, 3133.4267999999997),
 (3133.7941333333333, 3133.8621333333331),
 (3134.3581333333332, 3134.5641333333333),
 (3134.6434666666664, 3134.6774666666665),
 (3163.1974666666665, 3163.2374666666665),
 (3165.4668000000001, 3165.5194666666666),
 (3165.5828000000001, 3165.6301333333331),
 (3166.3594666666668, 3166.4054666666666),
 (3166.5114666666668, 3166.5921333333331),
 (3167.1674666666668, 3167.2467999999999),
 (3167.5207999999998, 3167.5587999999998),
 (3167.6381333333334, 3167.6907999999999),
 (3168.5614666666665, 3168.5947999999999),
 (3180.2881333333335, 3180.3301333333334),
 (3195.4708000000001, 3195.5227999999997),
 (3195.9941333333331, 3196.0721333333331),
 (3196.0801333333334, 3196.1988000000001),
 (3196.2534666666666, 3196.2887999999998),
 (3210.2261333333331, 3210.2907999999998),
 (3217.1094666666668, 3217.1661333333332),
 (3218.3501333333334, 3218.4061333333334),
 (3218.5494666666664, 3218.6694666666667),
 (3218.8101333333334, 3218.9647999999997),
 (3219.0914666666667, 3219.1567999999997),
 (3219.3634666666667, 3219.3981333333331),
 (3219.4441333333334, 3219.5007999999998),
 (3220.9714666666664, 3221.0954666666667),
 (3223.5734666666667, 3223.6114666666667),
 (3225.2327999999998, 3225.3621333333331),
 (3225.4301333333333, 3225.4854666666665),
 (3236.0014666666666, 3236.1154666666666),
 (3237.0281333333332, 3237.1194666666665),
 (3238.1814666666664, 3238.2228),
 (3238.4974666666667, 3238.5281333333332),
 (3239.2581333333333, 3239.3114666666665),
 (3240.6601333333333, 3240.7074666666667),
 (3256.6967999999997, 3256.7421333333332),
 (3256.7941333333333, 3257.0681333333332),
 (3268.4621333333334, 3268.5654666666665),
 (3270.9787999999999, 3271.0614666666665),
 (3272.2634666666663, 3272.3321333333333),
 (3282.4287999999997, 3282.4827999999998),
 (3282.7828, 3282.8174666666664),
 (3282.8368, 3282.8681333333334),
 (3293.1874666666668, 3293.2414666666664),
 (3293.3807999999999, 3293.4427999999998),
 (3296.5601333333334, 3296.6641333333332),
 (3297.4674666666665, 3297.5174666666667),
 (3305.0921333333331, 3305.1808000000001),
 (3306.6081333333332, 3306.6527999999998),
 (3306.8108000000002, 3306.8974666666663),
 (3312.7481333333335, 3312.8067999999998),
 (3312.8948, 3313.0027999999998),
 (3314.1981333333333, 3314.2521333333334),
 (3314.4387999999999, 3314.4721333333332),
 (3314.7154666666665, 3314.7614666666668),
 (3315.8934666666664, 3315.9974666666667),
 (3328.0561333333335, 3328.1494666666667),
 (3340.3108000000002, 3340.3688000000002),
 (3353.7647999999999, 3353.8434666666667),
 (3359.9694666666664, 3360.1228000000001),
 (3360.2467999999999, 3360.2734666666665),
 (3360.6321333333335, 3360.6547999999998),
 (3360.8734666666664, 3360.9234666666666),
 (3361.0254666666665, 3361.0614666666665),
 (3361.3087999999998, 3361.4148),
 (3362.7861333333331, 3362.9034666666666),
 (3363.6961333333334, 3363.7461333333331),
 (3364.0994666666666, 3364.1848),
 (3365.3247999999999, 3365.3681333333334),
 (3377.6581333333334, 3377.7127999999998),
 (3378.0234666666665, 3378.0508),
 (3378.1808000000001, 3378.2734666666665),
 (3378.3807999999999, 3378.4541333333332),
 (3378.6654666666664, 3378.7154666666665),
 (3387.634133333333, 3387.6654666666664),
 (3389.5854666666664, 3389.9081333333334),
 (3390.9134666666669, 3391.0201333333334),
 (3391.3561333333332, 3391.4041333333334),
 (3409.9694666666664, 3410.0541333333331),
 (3410.8914666666665, 3410.9294666666665),
 (3411.0407999999998, 3411.1054666666664),
 (3412.7174666666665, 3412.8114666666665),
 (3418.7507999999998, 3418.8254666666667),
 (3425.0634666666665, 3425.1581333333334),
 (3425.8688000000002, 3425.9134666666669),
 (3426.0201333333334, 3426.0608000000002),
 (3426.0694666666668, 3426.2294666666667),
 (3426.7961333333333, 3426.8527999999997),
 (3427.0987999999998, 3427.192133333333),
 (3427.6734666666666, 3427.7234666666664),
 (3428.0141333333331, 3428.1334666666667),
 (3428.1494666666667, 3428.2608),
 (3434.0114666666668, 3434.058133333333),
 (3434.1088, 3434.1601333333333),
 (3434.3301333333334, 3434.3788),
 (3435.1174666666666, 3435.1648),
 (3436.3614666666667, 3436.4074666666666),
 (3436.9934666666668, 3437.0441333333333),
 (3437.1361333333334, 3437.2348000000002),
 (3437.4694666666664, 3437.5848000000001),
 (3445.2788, 3445.3654666666666),
 (3451.2774666666664, 3451.3274666666666),
 (3458.0088000000001, 3458.1101333333331),
 (3470.7974666666664, 3470.8421333333331),
 (3472.2574666666665, 3472.3221333333331),
 (3472.3941333333332, 3472.4674666666665),
 (3475.1474666666663, 3475.1901333333335),
 (3476.2547999999997, 3476.3027999999999),
 (3476.384133333333, 3476.4154666666664),
 (3478.4041333333334, 3478.4354666666668),
 (3478.8541333333333, 3478.9074666666666),
 (3516.2467999999999, 3516.3568),
 (3530.6367999999998, 3530.7161333333333),
 (3531.6734666666666, 3531.7801333333332),
 (3531.8614666666667, 3531.9467999999997),
 (3535.3881333333334, 3535.4301333333333),
 (3536.8294666666666, 3536.8781333333332),
 (3537.1621333333333, 3537.1994666666665),
 (3537.3481333333334, 3537.4514666666664),
 (3538.0747999999999, 3538.1147999999998),
 (3538.1561333333334, 3538.2228),
 (3538.558133333333, 3538.6054666666664),
 (3541.7187999999996, 3541.7914666666666),
 (3545.8481333333334, 3545.9014666666667),
 (3545.9061333333334, 3545.960133333333),
 (3548.5274666666664, 3548.5554666666667),
 (3563.1654666666664, 3563.1934666666666),
 (3564.1494666666667, 3564.2114666666666),
 (3578.0587999999998, 3578.1074666666664),
 (3578.7847999999999, 3578.8281333333334),
 (3578.9207999999999, 3578.9974666666667),
 (3579.4074666666666, 3579.500133333333),
 (3585.6294666666663, 3585.6914666666667),
 (3585.7554666666665, 3585.9061333333334),
 (3585.9614666666666, 3586.0101333333332),
 (3586.0901333333331, 3586.1281333333332),
 (3597.8548000000001, 3597.8887999999997),
 (3598.5134666666663, 3598.5627999999997),
 (3599.4128000000001, 3599.4694666666664),
 (3611.6687999999999, 3611.7574666666665),
 (3611.7628, 3611.8101333333334),
 (3611.8407999999999, 3611.9827999999998),
 (3612.9447999999998, 3612.9987999999998),
 (3613.0441333333333, 3613.1154666666666),
 (3614.6327999999999, 3614.6714666666667),
 (3614.7527999999998, 3614.8447999999999),
 (3615.9541333333332, 3615.9874666666665),
 (3616.1841333333332, 3616.2094666666667),
 (3627.1841333333332, 3627.2334666666666),
 (3627.7974666666664, 3627.8721333333333),
 (3628.3254666666667, 3628.3807999999999),
 (3628.4107999999997, 3628.5194666666666),
 (3629.2687999999998, 3629.3554666666664),
 (3629.4101333333333, 3629.6514666666667),
 (3641.5267999999996, 3641.5688),
 (3641.7534666666666, 3641.8314666666665),
 (3641.924133333333, 3641.9714666666669),
 (3642.4287999999997, 3642.4994666666666),
 (3642.7381333333333, 3642.7841333333331),
 (3642.8934666666664, 3642.9954666666667),
 (3643.2988, 3643.3908000000001),
 (3643.9074666666666, 3643.9434666666666),
 (3653.5161333333331, 3653.634133333333),
 (3653.6394666666665, 3653.7287999999999),
 (3653.732133333333, 3653.7821333333331),
 (3654.7941333333333, 3654.8474666666666),
 (3654.8861333333334, 3655.1581333333334),
 (3656.0868, 3656.1188000000002),
 (3660.9841333333334, 3661.0574666666666),
 (3661.7447999999999, 3661.7968000000001),
 (3662.8394666666663, 3662.9301333333333),
 (3671.7281333333331, 3671.8054666666667),
 (3676.9987999999998, 3677.0674666666664),
 (3677.9181333333331, 3677.9501333333333),
 (3678.3301333333334, 3678.3748000000001),
 (3679.1507999999999, 3679.1841333333332),
 (3687.7614666666668, 3687.8141333333333),
 (3688.1588000000002, 3688.3688000000002),
 (3688.5461333333333, 3688.5987999999998),
 (3689.1828, 3689.2274666666667),
 (3689.3274666666666, 3689.3607999999999),
 (3689.4488000000001, 3689.5587999999998),
 (3689.8647999999998, 3689.9394666666667),
 (3691.0914666666667, 3691.2267999999999),
 (3704.1828, 3704.2154666666665),
 (3704.9121333333333, 3704.9494666666665),
 (3705.0194666666666, 3705.0874666666668),
 (3705.9407999999999, 3705.9728),
 (3706.2574666666665, 3706.3214666666663),
 (3707.8594666666668, 3707.9214666666667),
 (3708.4994666666666, 3708.5474666666664),
 (3721.3114666666665, 3721.4141333333332),
 (3721.4268000000002, 3721.6127999999999),
 (3721.6554666666666, 3721.7701333333334),
 (3736.3254666666667, 3736.5081333333333),
 (3736.6088, 3736.6821333333332),
 (3736.8554666666664, 3736.9107999999997),
 (3737.5288, 3737.5807999999997),
 (3738.9628000000002, 3739.0534666666663),
 (3739.1167999999998, 3739.1867999999999),
 (3739.7107999999998, 3739.7461333333331),
 (3740.4554666666663, 3740.4928),
 (3740.6721333333335, 3740.6988000000001),
 (3740.7094666666667, 3740.7661333333335),
 (3740.7774666666664, 3740.8148000000001),
 (3741.4587999999999, 3741.5381333333335),
 (3742.5414666666666, 3742.5927999999999),
 (3743.1487999999999, 3743.2294666666667),
 (3743.6848, 3743.7428),
 (3754.1381333333329, 3754.2401333333332),
 (3754.2847999999999, 3754.3548000000001),
 (3755.8141333333333, 3755.9528),
 (3755.9794666666667, 3756.0154666666667),
 (3756.1301333333331, 3756.1714666666667),
 (3757.8474666666666, 3757.9454666666666),
 (3763.5927999999999, 3763.6487999999999),
 (3763.7221333333332, 3763.7534666666666),
 (3764.0347999999999, 3764.0834666666665),
 (3764.3514666666665, 3764.4561333333331),
 (3772.9168, 3772.9541333333332),
 (3774.1254666666664, 3774.290133333333),
 (3784.3247999999999, 3784.3881333333329),
 (3784.9321333333332, 3784.982133333333),
 (3785.6141333333335, 3785.6628000000001),
 (3785.8188, 3785.8861333333334),
 (3796.6514666666662, 3796.6774666666665),
 (3798.1361333333334, 3798.1734666666666),
 (3798.7241333333332, 3798.7808),
 (3798.8334666666665, 3798.9047999999998),
 (3800.2554666666665, 3800.2941333333333),
 (3800.3647999999998, 3800.4668000000001),
 (3801.6254666666664, 3801.6801333333333),
 (3802.7461333333331, 3802.8208),
 (3803.0741333333335, 3803.1314666666667),
 (3812.8761333333332, 3812.9141333333332),
 (3814.1107999999999, 3814.1954666666666),
 (3814.3681333333334, 3814.4327999999996),
 (3814.6234666666669, 3814.6894666666667),
 (3815.0667999999996, 3815.1188000000002),
 (3815.1994666666665, 3815.3074666666666),
 (3815.3288000000002, 3815.4268000000002),
 (3825.3901333333333, 3825.4174666666668),
 (3827.1294666666663, 3827.1861333333331),
 (3827.7201333333333, 3827.7994666666664),
 (3828.4301333333333, 3828.4848000000002),
 (3828.4974666666667, 3828.5601333333334),
 (3829.9881333333333, 3830.0634666666665),
 (3830.3634666666667, 3830.4721333333332),
 (3830.7361333333333, 3830.7788),
 (3830.9227999999998, 3830.9587999999999),
 (3830.9974666666667, 3831.0281333333332),
 (3832.0141333333331, 3832.0821333333333),
 (3832.4501333333333, 3832.6114666666663),
 (3832.8394666666663, 3832.8788),
 (3833.2014666666664, 3833.2694666666666),
 (3833.3981333333331, 3833.4387999999999),
 (3833.5694666666668, 3833.6581333333334),
 (3833.8534666666665, 3833.8941333333332),
 (3833.9621333333334, 3834.0487999999996),
 (3834.3401333333331, 3834.3881333333329),
 (3834.9274666666665, 3834.9567999999999),
 (3835.4814666666666, 3835.5108),
 (3835.5208000000002, 3835.6101333333331),
 (3835.6808000000001, 3835.7767999999996),
 (3836.3141333333333, 3836.3694666666665),
 (3837.1768000000002, 3837.2727999999997),
 (3837.3948, 3837.4214666666667),
 (3837.5734666666667, 3837.6114666666663),
 (3837.8494666666666, 3837.8941333333332),
 (3846.7274666666663, 3846.8427999999999),
 (3847.3454666666667, 3847.4027999999998),
 (3847.4507999999996, 3847.5047999999997),
 (3847.5434666666665, 3847.5874666666668),
 (3848.7594666666664, 3848.8208),
 (3848.9807999999998, 3849.1234666666669),
 (3849.1774666666665, 3849.2547999999997),
 (3850.7041333333332, 3850.7907999999998),
 (3861.2774666666664, 3861.3647999999998),
 (3861.4621333333334, 3861.5648000000001),
 (3870.6787999999997, 3870.7568000000001),
 (3870.7941333333333, 3870.8807999999999),
 (3871.3067999999998, 3871.3948),
 (3872.5308, 3872.558133333333),
 (3874.3927999999996, 3874.4541333333332),
 (3875.7801333333332, 3875.8134666666665),
 (3875.8761333333332, 3875.9628000000002),
 (3876.1781333333333, 3876.2228),
 (3876.4867999999997, 3876.5141333333331),
 (3876.5547999999999, 3876.5907999999999),
 (3878.9054666666666, 3878.9327999999996),
 (3879.9327999999996, 3880.0708),
 (3880.9407999999999, 3880.9754666666668),
 (3881.6768000000002, 3881.7421333333332),
 (3882.0101333333332, 3882.1014666666665),
 (3882.1914666666667, 3882.2781333333332),
 (3884.4327999999996, 3884.4841333333334),
 (3884.6701333333331, 3884.7034666666668),
 (3886.5227999999997, 3886.5574666666666),
 (3887.3341333333333, 3887.3807999999999),
 (3888.3854666666666, 3888.424133333333),
 (3888.5201333333334, 3888.6094666666668),
 (3889.4007999999999, 3889.4481333333333),
 (3889.6841333333332, 3889.7161333333333),
 (3890.4748, 3890.5381333333335),
 (3891.0834666666665, 3891.1441333333332),
 (3892.1188000000002, 3892.2341333333334),
 (3892.3754666666664, 3892.4574666666667),
 (3892.8101333333334, 3892.8908000000001),
 (3893.5034666666666, 3893.5608000000002),
 (3896.2921333333334, 3896.3494666666666),
 (3903.692133333333, 3903.8254666666667),
 (3903.9234666666666, 3903.9881333333333),
 (3904.5134666666663, 3904.5907999999999),
 (3904.7687999999998, 3904.8508000000002),
 (3904.9474666666665, 3905.018133333333),
 (3905.2721333333329, 3905.3981333333331),
 (3906.4088000000002, 3906.4774666666663),
 (3906.5208000000002, 3906.5841333333333),
 (3906.924133333333, 3906.9894666666669),
 (3907.2048, 3907.3987999999999),
 (3907.5921333333335, 3907.6421333333333),
 (3907.9627999999998, 3908.0561333333335),
 (3908.9094666666665, 3909.0421333333334),
 (3909.0567999999998, 3909.1081333333332),
 (3909.3627999999999, 3909.3987999999999),
 (3910.7087999999999, 3910.7641333333331),
 (3911.0788000000002, 3911.1194666666665),
 (3911.1507999999999, 3911.2401333333332),
 (3911.7001333333333, 3911.7394666666669),
 (3913.2261333333336, 3913.2828),
 (3913.5347999999999, 3913.6048000000001),
 (3913.6707999999999, 3913.7388000000001),
 (3918.5667999999996, 3918.6154666666666),
 (3919.1041333333333, 3919.1448),
 (3919.2221333333332, 3919.2561333333333)]

In [133]:
ripple_start, ripple_end = ripple_times[0]
position.loc[ripple_start:ripple_end].plot(y='speed')
ripple_end - ripple_start


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-133-0ebcf75101ff> in <module>()
      1 ripple_start, ripple_end = ripple_times[0]
----> 2 position.loc[ripple_start:ripple_end].plot(y='speed')
      3 ripple_end - ripple_start

NameError: name 'position' is not defined

Kay method


In [182]:
filtered_lfps = [pd.Series(ripple_detection._ripple_bandpass_filter(lfp.values.flatten()), index=lfp.index)
                 for lfp in CA1_lfps]
combined_lfps = np.sum(pd.concat(filtered_lfps, axis=1) ** 2, axis=1)
smooth_combined_lfps = pd.Series(
    ripple_detection._smooth(
        combined_lfps.values.flatten(), sigma=0.004, sampling_frequency=1500),
    index=combined_lfps.index)

zscored_combined_lfps = ripple_detection._zscore(np.sqrt(smooth_combined_lfps)).values.flatten()
threshold_df = ripple_detection._threshold_by_zscore(
    np.sqrt(smooth_combined_lfps), zscore_threshold=2)

candidate_ripple_times = list(sorted(ripple_detection._extend_threshold_to_mean(
        threshold_df.is_above_mean, threshold_df.is_above_threshold,
        minimum_duration=0.015)))

In [181]:
fig, axes = plt.subplots(5, figsize=(12,9))

pd.concat(CA1_lfps, axis=1).iloc[0:1500].plot(ax=axes[0])

pd.concat(filtered_lfps, axis=1).iloc[0:1500].plot(ax=axes[1])

combined_lfps.iloc[0:1500].plot(ax=axes[2])
smooth_combined_lfps.iloc[0:1500].plot(ax=axes[2])

pd.DataFrame({
        'zscored_signal': zscored_combined_lfps, 
        'is_above_mean': threshold_df.is_above_mean,
        'is_above_threshold': threshold_df.is_above_threshold
    }).iloc[0:1500].plot(ax=axes[3])
axes[3].axhline(2, color='black', linestyle=':')
position_df = data_processing.get_interpolated_position_dataframe(epoch_index, animals)
position_df.iloc[0:1500].plot(y='speed', ax=axes[4])


Out[181]:
<matplotlib.axes._subplots.AxesSubplot at 0x16233d390>

In [177]:
fig, axes = plt.subplots(5, figsize=(12,9))
candidate_ripple_start, candidate_ripple_end = candidate_ripple_times[0]

pd.concat(CA1_lfps, axis=1).loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500].plot(ax=axes[0])

pd.concat(filtered_lfps, axis=1).loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500].plot(ax=axes[1])

combined_lfps.loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500].plot(ax=axes[2])
smooth_combined_lfps.loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500].plot(ax=axes[2])

pd.DataFrame({
        'zscored_signal': zscored_combined_lfps, 
        'is_above_mean': threshold_df.is_above_mean,
        'is_above_threshold': threshold_df.is_above_threshold
    }).loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500].plot(ax=axes[3])
axes[3].axhline(2, color='black', linestyle=':')
axes[3].axvspan(candidate_ripple_start, candidate_ripple_end, facecolor='green', alpha=0.3)
position_df = data_processing.get_interpolated_position_dataframe(epoch_index, animals)
position_df.loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500, :].plot(y='speed', ax=axes[4])


Out[177]:
<matplotlib.axes._subplots.AxesSubplot at 0x1dd59f588>

In [128]:
ripple_detection.Kay_method(CA1_lfps)


Out[128]:
[(2718.1574666666666, 2718.1941333333334),
 (2718.6941333333334, 2718.7441333333331),
 (2718.8307999999997, 2718.9088000000002),
 (2719.0981333333334, 2719.1387999999997),
 (2719.7754666666665, 2719.9334666666664),
 (2720.2414666666664, 2720.3681333333334),
 (2721.4328, 2721.5407999999998),
 (2723.3954666666668, 2723.4661333333333),
 (2728.5534666666667, 2728.6101333333331),
 (2730.1628000000001, 2730.2921333333334),
 (2731.7854666666667, 2731.8214666666668),
 (2734.6441333333332, 2734.7161333333333),
 (2734.9207999999999, 2735.0254666666665),
 (2736.9021333333335, 2736.9434666666666),
 (2738.2467999999999, 2738.3027999999999),
 (2738.3388, 2738.4354666666668),
 (2738.7981333333332, 2738.8521333333333),
 (2741.1394666666665, 2741.2241333333332),
 (2741.3388, 2741.4374666666668),
 (2741.4748, 2741.5194666666666),
 (2741.6614666666665, 2741.7714666666666),
 (2741.9387999999999, 2741.9741333333332),
 (2741.9821333333334, 2742.0387999999998),
 (2742.6828, 2742.7467999999999),
 (2744.1761333333334, 2744.4128000000001),
 (2744.7261333333331, 2744.8841333333335),
 (2745.2808, 2745.4734666666668),
 (2756.2601333333332, 2756.4154666666668),
 (2757.2028, 2757.2681333333335),
 (2757.4614666666666, 2757.6974666666665),
 (2761.4794666666667, 2761.6834666666664),
 (2769.9041333333334, 2769.9567999999999),
 (2771.1068, 2771.1974666666665),
 (2772.8568, 2772.9114666666665),
 (2775.7808, 2775.9168),
 (2776.2614666666668, 2776.4854666666665),
 (2776.5314666666668, 2776.6147999999998),
 (2779.4554666666668, 2779.5134666666668),
 (2781.1174666666666, 2781.1834666666664),
 (2785.1687999999999, 2785.2628),
 (2785.6048000000001, 2785.6487999999999),
 (2788.1061333333332, 2788.1341333333335),
 (2789.5921333333331, 2789.6468),
 (2790.6327999999999, 2790.7494666666666),
 (2792.1081333333332, 2792.2968000000001),
 (2796.652133333333, 2796.6954666666666),
 (2803.8734666666664, 2803.9314666666664),
 (2805.7614666666668, 2805.7861333333331),
 (2806.5361333333331, 2806.5967999999998),
 (2807.3894666666665, 2807.4427999999998),
 (2807.4834666666666, 2807.5314666666668),
 (2808.4148, 2808.4914666666664),
 (2816.2808, 2816.3348000000001),
 (2818.9814666666666, 2819.0207999999998),
 (2825.9481333333333, 2826.0114666666668),
 (2829.0361333333331, 2829.0974666666666),
 (2831.1448, 2831.1894666666667),
 (2833.0787999999998, 2833.152133333333),
 (2835.7287999999999, 2835.8174666666664),
 (2837.8481333333334, 2837.9074666666666),
 (2838.1127999999999, 2838.1881333333331),
 (2838.2554666666665, 2838.3241333333331),
 (2838.3381333333332, 2838.4508000000001),
 (2839.4488000000001, 2839.5801333333334),
 (2839.6474666666668, 2839.6887999999999),
 (2839.8528000000001, 2840.0334666666668),
 (2840.0347999999999, 2840.1674666666668),
 (2840.3074666666666, 2840.3487999999998),
 (2840.5488, 2840.8894666666665),
 (2841.4767999999999, 2841.5674666666664),
 (2841.7214666666664, 2841.8221333333331),
 (2842.0088000000001, 2842.0961333333335),
 (2846.1507999999999, 2846.2114666666666),
 (2850.4748, 2850.5401333333334),
 (2852.6974666666665, 2852.7847999999999),
 (2852.8574666666664, 2852.9447999999998),
 (2853.2547999999997, 2853.3467999999998),
 (2853.4654666666665, 2853.5521333333331),
 (2853.7067999999999, 2853.7907999999998),
 (2853.8201333333332, 2853.8694666666665),
 (2855.2081333333331, 2855.2628),
 (2857.4587999999999, 2857.6101333333331),
 (2857.6448, 2857.7541333333334),
 (2860.0361333333331, 2860.1361333333334),
 (2866.5894666666668, 2866.6801333333333),
 (2866.9194666666667, 2866.9694666666664),
 (2868.2547999999997, 2868.3074666666666),
 (2870.8961333333332, 2870.9274666666665),
 (2871.1967999999997, 2871.2554666666665),
 (2872.3328000000001, 2872.3794666666668),
 (2873.1788000000001, 2873.2768000000001),
 (2874.5321333333331, 2874.5688),
 (2875.3434666666667, 2875.3914666666665),
 (2876.5494666666664, 2876.6281333333332),
 (2885.6867999999999, 2885.7147999999997),
 (2888.9761333333331, 2889.0167999999999),
 (2892.7841333333331, 2892.8627999999999),
 (2900.1468, 2900.2234666666668),
 (2900.6801333333333, 2900.8407999999999),
 (2905.7107999999998, 2905.7434666666668),
 (2905.7781333333332, 2905.8721333333333),
 (2907.1828, 2907.2801333333332),
 (2907.402133333333, 2907.4888000000001),
 (2908.3687999999997, 2908.4627999999998),
 (2908.4761333333331, 2908.5721333333331),
 (2908.7608, 2908.8987999999999),
 (2909.4847999999997, 2909.5488),
 (2909.6927999999998, 2909.7934666666665),
 (2909.8621333333331, 2909.9401333333335),
 (2915.4521333333332, 2915.5154666666667),
 (2915.9854666666665, 2916.0281333333332),
 (2916.7121333333334, 2916.8641333333335),
 (2918.0621333333333, 2918.1394666666665),
 (2918.3194666666668, 2918.3968),
 (2924.3021333333331, 2924.4267999999997),
 (2924.7714666666666, 2924.8701333333333),
 (2925.9934666666668, 2926.0994666666666),
 (2933.1268, 2933.1628000000001),
 (2933.2061333333331, 2933.2974666666664),
 (2934.0121333333332, 2934.0814666666665),
 (2934.3961333333332, 2934.4607999999998),
 (2935.4367999999999, 2935.5394666666666),
 (2935.5488, 2935.6574666666666),
 (2935.7561333333333, 2935.7881333333335),
 (2937.9607999999998, 2938.0661333333333),
 (2938.2561333333333, 2938.3134666666665),
 (2942.6141333333335, 2942.6861333333331),
 (2944.0754666666667, 2944.1248000000001),
 (2944.1261333333332, 2944.2181333333333),
 (2944.3434666666667, 2944.3914666666665),
 (2944.5341333333331, 2944.5641333333333),
 (2946.6561333333334, 2946.7281333333331),
 (2947.3334666666665, 2947.3834666666667),
 (2953.3661333333334, 2953.4314666666664),
 (2953.8208, 2953.8601333333331),
 (2954.6048000000001, 2954.6947999999998),
 (2956.6774666666665, 2956.7654666666667),
 (2963.4754666666668, 2963.5594666666666),
 (2966.0561333333335, 2966.1014666666665),
 (2966.3794666666668, 2966.4241333333334),
 (2966.6547999999998, 2966.7114666666666),
 (2967.9247999999998, 2967.9827999999998),
 (2970.9174666666668, 2970.9534666666668),
 (2972.326133333333, 2972.402133333333),
 (2972.4508000000001, 2972.5201333333334),
 (2988.6127999999999, 2988.7001333333333),
 (2989.0221333333334, 2989.1034666666665),
 (2991.7781333333332, 2991.9067999999997),
 (2992.7274666666667, 2992.7994666666664),
 (2995.6734666666666, 2995.7214666666664),
 (3000.9261333333334, 3001.1401333333333),
 (3009.4548, 3009.4981333333335),
 (3009.4994666666666, 3009.5561333333335),
 (3009.7314666666666, 3009.7994666666664),
 (3010.5894666666668, 3010.6581333333334),
 (3011.1687999999999, 3011.2734666666665),
 (3011.5767999999998, 3011.6714666666667),
 (3012.018133333333, 3012.0907999999999),
 (3012.1988000000001, 3012.2527999999998),
 (3012.2981333333332, 3012.4154666666664),
 (3012.4207999999999, 3012.5108),
 (3012.7348000000002, 3012.7961333333333),
 (3012.9081333333334, 3012.9701333333333),
 (3012.9821333333334, 3013.0714666666668),
 (3018.6768000000002, 3018.7814666666663),
 (3020.2948000000001, 3020.3494666666666),
 (3021.1201333333333, 3021.1887999999999),
 (3021.2727999999997, 3021.4501333333333),
 (3021.4607999999998, 3021.5154666666667),
 (3021.6061333333332, 3021.6487999999999),
 (3021.8168000000001, 3021.9328),
 (3022.3714666666665, 3022.4787999999999),
 (3022.4888000000001, 3022.6094666666668),
 (3024.210133333333, 3024.3334666666665),
 (3025.6201333333333, 3025.6588000000002),
 (3026.5781333333334, 3026.6454666666668),
 (3030.7374666666665, 3030.8214666666668),
 (3037.9101333333333, 3037.9848000000002),
 (3038.3307999999997, 3038.402133333333),
 (3040.7814666666663, 3040.8694666666665),
 (3044.7461333333331, 3044.7954666666665),
 (3045.6841333333332, 3045.7194666666664),
 (3058.1894666666667, 3058.2994666666664),
 (3058.4921333333332, 3058.5407999999998),
 (3062.3461333333335, 3062.3748000000001),
 (3064.2781333333332, 3064.4414666666667),
 (3066.8561333333332, 3066.9721333333332),
 (3067.5774666666666, 3067.6654666666664),
 (3069.9634666666666, 3070.0621333333333),
 (3070.4954666666667, 3070.5934666666667),
 (3071.2034666666668, 3071.2501333333335),
 (3074.5088000000001, 3074.5554666666667),
 (3074.7054666666668, 3074.7854666666667),
 (3075.7034666666668, 3075.8741333333332),
 (3076.7734666666665, 3076.8701333333333),
 (3078.5747999999999, 3078.6274666666668),
 (3080.0814666666665, 3080.1494666666667),
 (3080.2147999999997, 3080.4374666666668),
 (3080.7601333333332, 3080.8101333333334),
 (3080.8188, 3080.8961333333332),
 (3080.9354666666668, 3080.9934666666668),
 (3081.4514666666664, 3081.4841333333334),
 (3083.0101333333332, 3083.0587999999998),
 (3090.2594666666664, 3090.3407999999999),
 (3090.5641333333333, 3090.6288),
 (3091.2661333333331, 3091.4061333333334),
 (3100.2808, 3100.3528000000001),
 (3101.2808, 3101.3221333333331),
 (3106.1614666666665, 3106.2034666666668),
 (3107.0401333333334, 3107.0828000000001),
 (3107.6894666666667, 3107.7294666666667),
 (3108.0061333333333, 3108.1094666666668),
 (3111.9934666666668, 3112.1421333333333),
 (3112.1468, 3112.1947999999998),
 (3113.2374666666665, 3113.2854666666667),
 (3116.4787999999999, 3116.5688),
 (3119.3894666666665, 3119.4874666666665),
 (3120.652133333333, 3120.7527999999998),
 (3121.1367999999998, 3121.1754666666666),
 (3121.2514666666666, 3121.3134666666665),
 (3121.8728000000001, 3121.9914666666664),
 (3125.5347999999999, 3125.5961333333335),
 (3127.9081333333334, 3127.9541333333332),
 (3128.1547999999998, 3128.2254666666668),
 (3128.3121333333333, 3128.3781333333332),
 (3128.7181333333333, 3128.7781333333332),
 (3129.3647999999998, 3129.4654666666665),
 (3131.9574666666667, 3132.0214666666666),
 (3133.3481333333334, 3133.4201333333331),
 (3133.7748000000001, 3133.8508000000002),
 (3135.8761333333332, 3135.9374666666668),
 (3136.5281333333332, 3136.6114666666667),
 (3136.6727999999998, 3136.7361333333333),
 (3136.7948000000001, 3136.8588),
 (3140.4454666666666, 3140.4867999999997),
 (3141.7861333333331, 3141.8528000000001),
 (3142.7001333333333, 3142.7561333333333),
 (3154.6101333333331, 3154.6474666666668),
 (3156.2781333333332, 3156.3494666666666),
 (3158.1081333333332, 3158.1994666666665),
 (3158.2348000000002, 3158.2941333333333),
 (3158.9007999999999, 3158.9367999999999),
 (3161.3541333333333, 3161.4174666666668),
 (3165.4681333333333, 3165.5508),
 (3172.1481333333331, 3172.1734666666666),
 (3174.8334666666665, 3174.9647999999997),
 (3176.3721333333333, 3176.460133333333),
 (3180.2748000000001, 3180.3254666666667),
 (3186.7367999999997, 3186.8274666666666),
 (3188.8174666666664, 3188.8514666666665),
 (3190.8294666666666, 3190.8894666666665),
 (3190.942133333333, 3191.0648000000001),
 (3191.7707999999998, 3191.8447999999999),
 (3192.4501333333333, 3192.5121333333332),
 (3192.5961333333335, 3192.6421333333333),
 (3195.9328, 3196.0708),
 (3196.0874666666668, 3196.1454666666668),
 (3200.4721333333332, 3200.5914666666667),
 (3202.1381333333334, 3202.2394666666664),
 (3202.2901333333334, 3202.3701333333333),
 (3202.9708000000001, 3203.0034666666666),
 (3206.4647999999997, 3206.5194666666666),
 (3206.6147999999998, 3206.6734666666666),
 (3207.4074666666666, 3207.4521333333332),
 (3210.2428, 3210.2994666666664),
 (3214.7494666666666, 3214.8061333333335),
 (3215.4407999999999, 3215.5241333333333),
 (3215.5641333333333, 3215.6721333333335),
 (3215.7514666666666, 3215.8107999999997),
 (3217.1161333333334, 3217.1614666666665),
 (3218.8634666666667, 3218.9587999999999),
 (3221.0094666666664, 3221.0627999999997),
 (3225.2494666666666, 3225.3694666666665),
 (3232.2914666666666, 3232.3361333333332),
 (3237.0541333333331, 3237.1201333333333),
 (3239.2574666666665, 3239.3134666666665),
 (3247.9114666666665, 3247.9454666666666),
 (3248.0527999999999, 3248.1088),
 (3248.210133333333, 3248.2528000000002),
 (3256.8047999999999, 3257.0634666666665),
 (3260.0821333333333, 3260.1907999999999),
 (3263.3761333333332, 3263.4168),
 (3264.0128, 3264.1381333333334),
 (3264.1654666666664, 3264.2634666666663),
 (3264.2994666666664, 3264.3548000000001),
 (3264.8214666666663, 3264.9341333333332),
 (3264.9494666666665, 3265.0414666666666),
 (3265.0508, 3265.1474666666663),
 (3265.1874666666668, 3265.2914666666666),
 (3265.3121333333333, 3265.3508000000002),
 (3268.4714666666669, 3268.5634666666665),
 (3269.1487999999999, 3269.2121333333334),
 (3272.2687999999998, 3272.3274666666666),
 (3276.1001333333334, 3276.174133333333),
 (3276.2261333333331, 3276.3294666666666),
 (3277.5007999999998, 3277.5521333333331),
 (3282.7847999999999, 3282.8154666666665),
 (3284.8267999999998, 3284.884133333333),
 (3285.2048, 3285.3047999999999),
 (3287.3047999999999, 3287.3594666666668),
 (3287.7327999999998, 3287.7968000000001),
 (3288.0407999999998, 3288.0734666666667),
 (3298.8161333333333, 3298.8694666666665),
 (3301.0608000000002, 3301.1294666666668),
 (3306.8134666666665, 3306.8854666666666),
 (3322.4701333333333, 3322.5294666666668),
 (3324.3074666666666, 3324.3987999999999),
 (3325.2934666666665, 3325.3714666666665),
 (3328.1008000000002, 3328.1481333333331),
 (3329.9374666666668, 3330.0334666666668),
 (3331.0888, 3331.1301333333331),
 (3334.4941333333331, 3334.5401333333334),
 (3335.2214666666669, 3335.2841333333331),
 (3335.4874666666665, 3335.5401333333334),
 (3335.5954666666667, 3335.7181333333333),
 (3337.1561333333334, 3337.2294666666667),
 (3337.2507999999998, 3337.3754666666664),
 (3337.6254666666664, 3337.7014666666664),
 (3337.8054666666667, 3337.8634666666667),
 (3337.9328, 3338.0608000000002),
 (3338.0648000000001, 3338.1408000000001),
 (3338.3008, 3338.3401333333331),
 (3343.6367999999998, 3343.6794666666665),
 (3344.2008000000001, 3344.2694666666666),
 (3345.1527999999998, 3345.2721333333334),
 (3345.4247999999998, 3345.5187999999998),
 (3345.8968, 3345.9741333333332),
 (3346.3361333333332, 3346.3794666666663),
 (3347.9714666666669, 3348.0394666666666),
 (3348.3714666666665, 3348.4721333333332),
 (3349.7867999999999, 3349.8501333333334),
 (3353.7647999999999, 3353.8361333333332),
 (3353.8581333333332, 3353.9001333333331),
 (3355.2974666666664, 3355.3641333333335),
 (3357.6808000000001, 3357.7634666666663),
 (3358.8801333333331, 3358.9947999999999),
 (3362.8467999999998, 3362.8928000000001),
 (3366.9101333333333, 3367.0088000000001),
 (3367.4181333333331, 3367.5421333333334),
 (3367.6314666666667, 3367.6727999999998),
 (3367.9941333333331, 3368.1107999999999),
 (3368.4154666666664, 3368.4761333333331),
 (3368.5554666666667, 3368.5961333333335),
 (3371.768133333333, 3371.8921333333333),
 (3375.5314666666663, 3375.6221333333333),
 (3376.0614666666665, 3376.1554666666666),
 (3379.4767999999999, 3379.5134666666663),
 (3381.116133333333, 3381.2381333333333),
 (3381.3728000000001, 3381.4767999999999),
 (3381.5221333333334, 3381.6068),
 (3381.7714666666666, 3382.0334666666668),
 (3383.116133333333, 3383.1661333333332),
 (3386.3794666666663, 3386.4754666666668),
 (3389.6041333333333, 3389.7021333333332),
 (3389.7628, 3389.826133333333),
 (3389.8641333333335, 3389.9088000000002),
 (3390.9101333333333, 3391.0101333333332),
 (3393.9321333333332, 3393.9901333333332),
 (3396.674133333333, 3396.7434666666668),
 (3397.3961333333332, 3397.4227999999998),
 (3400.2581333333333, 3400.3588),
 (3401.3834666666667, 3401.4381333333331),
 (3402.6334666666667, 3402.7201333333333),
 (3414.844133333333, 3414.9114666666665),
 (3416.2887999999998, 3416.3294666666666),
 (3422.8254666666667, 3422.8974666666663),
 (3425.8614666666667, 3425.9141333333332),
 (3426.0207999999998, 3426.0634666666665),
 (3426.0767999999998, 3426.1834666666664),
 (3426.7954666666665, 3426.8641333333335),
 (3427.1027999999997, 3427.1881333333331),
 (3427.6761333333334, 3427.7221333333332),
 (3428.0134666666663, 3428.1061333333332),
 (3428.1527999999998, 3428.2434666666668),
 (3429.8221333333331, 3429.8714666666665),
 (3430.4574666666667, 3430.6207999999997),
 (3431.2274666666667, 3431.2614666666668),
 (3431.2721333333334, 3431.3501333333334),
 (3432.1661333333332, 3432.2467999999999),
 (3440.1234666666664, 3440.1614666666665),
 (3440.4841333333334, 3440.5207999999998),
 (3440.5288, 3440.5868),
 (3441.9614666666666, 3442.0134666666663),
 (3442.0561333333335, 3442.116133333333),
 (3445.2894666666666, 3445.3368),
 (3446.2301333333335, 3446.3168000000001),
 (3448.9207999999999, 3448.9801333333335),
 (3449.4334666666664, 3449.5128),
 (3450.5508, 3450.6001333333334),
 (3451.2794666666668, 3451.3254666666667),
 (3451.6641333333332, 3451.7374666666665),
 (3451.7714666666666, 3451.8281333333334),
 (3453.9641333333334, 3454.0147999999999),
 (3458.0081333333333, 3458.1081333333332),
 (3459.3607999999999, 3459.4174666666668),
 (3460.3061333333335, 3460.4034666666666),
 (3460.8494666666666, 3460.8807999999999),
 (3461.0068000000001, 3461.0901333333331),
 (3461.3561333333332, 3461.4281333333333),
 (3461.5354666666667, 3461.6074666666664),
 (3464.5267999999996, 3464.5681333333332),
 (3465.6154666666666, 3465.6581333333334),
 (3465.7628, 3465.7928000000002),
 (3466.7934666666665, 3466.9221333333335),
 (3467.6547999999998, 3467.7154666666665),
 (3468.3788, 3468.4354666666668),
 (3472.3894666666665, 3472.4548),
 (3473.3561333333332, 3473.4114666666665),
 (3482.8374666666668, 3482.8861333333334),
 (3483.5207999999998, 3483.5654666666665),
 (3487.7907999999998, 3487.8314666666665),
 (3488.7334666666666, 3488.7814666666663),
 (3493.0281333333332, 3493.1327999999999),
 (3494.7994666666664, 3494.8688000000002),
 (3495.8274666666666, 3495.9067999999997),
 (3496.1461333333332, 3496.1901333333335),
 (3497.1021333333333, 3497.1554666666666),
 (3498.7781333333332, 3498.8994666666667),
 (3498.9501333333333, 3499.0414666666666),
 (3499.0554666666667, 3499.2894666666666),
 (3499.3174666666664, 3499.4081333333334),
 (3499.4387999999999, 3499.7467999999999),
 (3499.7521333333334, 3499.8394666666663),
 (3499.8514666666665, 3499.9234666666666),
 (3508.1327999999999, 3508.2154666666665),
 (3510.1574666666666, 3510.2008000000001),
 (3510.7581333333333, 3510.8581333333332),
 (3511.2661333333335, 3511.3627999999999),
 (3511.6387999999997, 3511.6774666666665),
 (3516.2867999999999, 3516.3601333333331),
 (3520.1534666666666, 3520.2061333333331),
 (3520.5041333333334, 3520.5621333333333),
 (3521.5468000000001, 3521.6274666666668),
 (3527.2141333333334, 3527.2447999999999),
 (3530.6441333333332, 3530.7127999999998),
 (3531.6814666666664, 3531.7727999999997),
 (3531.8634666666667, 3531.942133333333),
 (3537.3594666666668, 3537.4014666666667),
 (3552.0674666666664, 3552.1214666666665),
 (3552.2454666666667, 3552.2954666666665),
 (3552.4374666666663, 3552.4687999999996),
 (3553.2547999999997, 3553.3074666666666),
 (3557.4187999999999, 3557.4567999999999),
 (3557.5534666666667, 3557.6501333333331),
 (3559.6421333333333, 3559.7461333333331),
 (3569.4901333333332, 3569.5627999999997),
 (3569.9281333333333, 3569.9961333333331),
 (3570.0114666666668, 3570.0787999999998),
 (3571.1154666666666, 3571.1567999999997),
 (3573.7181333333333, 3573.768133333333),
 (3573.8434666666667, 3573.9314666666664),
 (3574.4227999999998, 3574.4634666666666),
 (3574.5128, 3574.5981333333334),
 (3574.6367999999998, 3574.7154666666665),
 (3574.750133333333, 3574.8734666666664),
 (3575.0047999999997, 3575.1094666666668),
 (3578.0594666666666, 3578.0994666666666),
 (3582.0981333333334, 3582.1907999999999),
 (3583.7748000000001, 3583.8388),
 (3584.1141333333335, 3584.2248),
 (3598.518133333333, 3598.5674666666664),
 (3601.8894666666665, 3601.9761333333331),
 (3602.5354666666667, 3602.6687999999999),
 (3602.8374666666668, 3602.8801333333331),
 (3603.0407999999998, 3603.0747999999999),
 (3603.5534666666667, 3603.6814666666664),
 (3604.3347999999996, 3604.4088000000002),
 (3607.5601333333334, 3607.5947999999999),
 (3611.6701333333331, 3611.7221333333332),
 (3611.8407999999999, 3611.9221333333335),
 (3612.9508000000001, 3612.9961333333331),
 (3617.0341333333331, 3617.1081333333332),
 (3619.2067999999999, 3619.2461333333331),
 (3628.3254666666667, 3628.3788),
 (3628.4168, 3628.5034666666666),
 (3629.4367999999999, 3629.4881333333333),
 (3629.5068000000001, 3629.6501333333331),
 (3630.9994666666666, 3631.0994666666666),
 (3631.5614666666665, 3631.6727999999998),
 (3631.9728, 3632.0214666666666),
 (3634.8614666666667, 3634.9301333333333),
 (3634.9787999999999, 3635.0534666666667),
 (3636.6041333333333, 3636.6887999999999),
 (3637.8008, 3637.8394666666663),
 (3638.3881333333334, 3638.5547999999999),
 (3641.7554666666665, 3641.8294666666666),
 (3641.9274666666665, 3641.9687999999996),
 (3642.4294666666665, 3642.5014666666666),
 (3644.7394666666664, 3644.844133333333),
 (3647.5607999999997, 3647.6534666666666),
 (3647.9801333333335, 3648.0488),
 (3648.1147999999998, 3648.2081333333331),
 (3649.7147999999997, 3649.7574666666665),
 (3650.2127999999998, 3650.3001333333332),
 (3650.3201333333332, 3650.3588),
 (3653.6707999999999, 3653.7274666666667),
 (3654.8968, 3655.0541333333331),
 (3655.0668000000001, 3655.1588000000002),
 (3659.4348, 3659.4794666666667),
 (3660.1988000000001, 3660.2628),
 (3680.0361333333331, 3680.0954666666667),
 (3682.6261333333332, 3682.7301333333335),
 (3683.0101333333332, 3683.0841333333333),
 (3683.6901333333335, 3683.7828),
 (3684.4827999999998, 3684.5648000000001),
 (3688.1954666666666, 3688.3001333333332),
 (3688.3047999999999, 3688.3481333333334),
 (3688.5474666666664, 3688.5907999999999),
 (3689.4501333333333, 3689.5534666666667),
 (3691.1014666666665, 3691.192133333333),
 (3694.5734666666667, 3694.6661333333332),
 (3698.1754666666666, 3698.2421333333332),
 (3698.2907999999998, 3698.3827999999999),
 (3699.0874666666668, 3699.1281333333332),
 (3699.4354666666668, 3699.5347999999999),
 (3700.3694666666665, 3700.5321333333331),
 (3700.8127999999997, 3700.9721333333332),
 (3701.0967999999998, 3701.1668),
 (3714.5694666666668, 3714.6787999999997),
 (3717.7414666666664, 3717.8034666666667),
 (3721.3168000000001, 3721.3781333333332),
 (3721.4308000000001, 3721.6061333333332),
 (3721.6781333333333, 3721.7248),
 (3723.2301333333335, 3723.2854666666667),
 (3725.6867999999999, 3725.7428),
 (3726.0901333333331, 3726.1541333333334),
 (3730.8514666666665, 3730.9234666666666),
 (3731.3161333333333, 3731.3721333333333),
 (3733.2254666666668, 3733.3241333333335),
 (3741.4634666666666, 3741.5381333333335),
 (3742.5414666666666, 3742.5828000000001),
 (3743.6734666666666, 3743.7401333333332),
 (3744.9441333333334, 3744.9934666666668),
 (3745.4674666666665, 3745.5481333333332),
 (3745.5934666666662, 3745.6787999999997),
 (3746.8027999999999, 3746.8814666666667),
 (3748.8134666666665, 3748.866133333333),
 (3748.9154666666664, 3748.9767999999999),
 (3750.3887999999997, 3750.4794666666667),
 (3750.5527999999999, 3750.6461333333332),
 (3751.4874666666665, 3751.5461333333333),
 (3754.2921333333334, 3754.3434666666662),
 (3755.8148000000001, 3755.8701333333333),
 (3755.8754666666664, 3755.9507999999996),
 (3756.1288, 3756.1714666666667),
 (3757.8414666666667, 3757.9367999999999),
 (3759.9761333333336, 3760.0801333333329),
 (3760.6681333333336, 3760.7388000000001),
 (3765.5288, 3765.5694666666668),
 (3767.1421333333333, 3767.2454666666663),
 (3768.1268, 3768.1634666666669),
 (3768.4774666666663, 3768.558133333333),
 (3768.7228, 3768.8067999999998),
 (3769.094133333333, 3769.1581333333334),
 (3774.1354666666666, 3774.2701333333334),
 (3774.3494666666666, 3774.4274666666665),
 (3777.2714666666666, 3777.3194666666668),
 (3779.1154666666666, 3779.174133333333),
 (3781.2121333333334, 3781.2614666666668),
 (3784.3334666666665, 3784.3814666666667),
 (3784.9367999999999, 3784.9767999999999),
 (3785.6147999999998, 3785.6641333333332),
 (3787.1207999999997, 3787.1861333333331),
 (3789.4841333333334, 3789.6008000000002),
 (3793.2921333333334, 3793.3567999999996),
 (3800.2134666666666, 3800.2821333333331),
 (3800.3734666666669, 3800.4621333333334),
 (3805.1801333333333, 3805.2841333333336),
 (3805.3361333333332, 3805.384133333333),
 (3806.7727999999997, 3806.9094666666665),
 (3809.0214666666666, 3809.0754666666667),
 (3810.0681333333332, 3810.1567999999997),
 (3814.3514666666665, 3814.4268000000002),
 (3815.0741333333335, 3815.1181333333334),
 (3815.2001333333333, 3815.3027999999999),
 (3815.3368, 3815.4207999999999),
 (3817.7701333333334, 3817.8927999999996),
 (3817.9814666666666, 3818.0321333333331),
 (3818.6774666666665, 3818.7788),
 (3818.9341333333332, 3819.1461333333332),
 (3819.3414666666667, 3819.4148),
 (3819.5174666666667, 3819.5774666666666),
 (3820.7394666666669, 3820.7834666666668),
 (3820.8641333333335, 3820.9161333333332),
 (3821.5074666666665, 3821.5847999999996),
 (3821.9194666666663, 3822.0341333333336),
 (3822.0387999999998, 3822.2128000000002),
 (3822.2381333333333, 3822.3074666666666),
 (3825.1181333333334, 3825.1774666666665),
 (3828.3954666666668, 3828.4841333333334),
 (3833.4007999999999, 3833.4654666666665),
 (3833.5227999999997, 3833.6487999999999),
 (3835.5261333333333, 3835.5868),
 (3835.7028, 3835.7774666666664),
 (3840.3534666666665, 3840.4521333333332),
 (3840.5007999999998, 3840.5521333333331),
 (3841.7994666666664, 3841.8688000000002),
 (3843.2161333333333, 3843.3061333333335),
 (3846.7254666666668, 3846.8407999999999),
 (3847.3514666666665, 3847.4007999999999),
 (3848.9827999999998, 3849.1214666666665),
 (3849.1881333333331, 3849.2521333333334),
 (3850.7327999999998, 3850.7828),
 (3854.2687999999998, 3854.3181333333332),
 (3854.6881333333331, 3854.7407999999996),
 (3857.4174666666668, 3857.5187999999998),
 (3858.0881333333332, 3858.1974666666665),
 (3858.6574666666666, 3858.7367999999997),
 (3858.7614666666668, 3858.8227999999999),
 (3858.8834666666667, 3858.9334666666664),
 (3859.1274666666668, 3859.3141333333333),
 (3859.3901333333333, 3859.4914666666664),
 (3864.8741333333332, 3864.9348),
 (3865.4488000000001, 3865.5201333333334),
 (3865.5294666666668, 3865.6021333333333),
 (3866.9174666666668, 3866.9841333333334),
 (3869.0487999999996, 3869.1048000000001),
 (3870.6861333333331, 3870.7561333333333),
 (3870.7981333333332, 3870.8554666666669),
 (3871.3247999999999, 3871.3774666666668),
 (3876.1808000000001, 3876.2208000000001),
 (3879.9334666666664, 3880.0694666666668),
 (3881.6687999999999, 3881.7334666666666),
 (3882.3094666666666, 3882.4047999999998),
 (3883.8254666666667, 3883.8614666666663),
 (3884.4341333333332, 3884.4848000000002),
 (3886.5241333333333, 3886.5601333333334),
 (3888.5314666666663, 3888.6041333333333),
 (3890.4754666666668, 3890.5101333333332),
 (3891.0907999999999, 3891.1154666666666),
 (3892.1754666666666, 3892.2374666666665),
 (3893.5061333333333, 3893.5501333333332),
 (3897.2974666666669, 3897.4107999999997),
 (3898.9214666666667, 3898.9567999999999),
 (3900.1887999999999, 3900.2781333333332),
 (3903.7021333333332, 3903.7708000000002),
 (3903.9308000000001, 3903.9774666666663),
 (3904.5141333333331, 3904.5754666666667),
 (3904.9454666666666, 3905.0101333333332),
 (3905.2748000000001, 3905.4214666666667),
 (3906.4081333333334, 3906.4721333333332),
 (3906.5154666666667, 3906.5781333333334),
 (3906.9274666666665, 3906.9874666666665),
 (3907.2394666666669, 3907.4081333333334),
 (3907.9647999999997, 3908.0387999999998),
 (3915.9928, 3916.0301333333332),
 (3916.6434666666664, 3916.6808000000001),
 (3917.0814666666665, 3917.1354666666666)]

In [129]:
ripple_detection.get_epoch_ripples(epoch_index, animals, sampling_frequency=1500,
                                   ripple_detection_function=ripple_detection.Kay_method)


Out[129]:
[(2723.3954666666668, 2723.4661333333333),
 (2731.7854666666667, 2731.8214666666668),
 (2742.6828, 2742.7467999999999),
 (2771.1068, 2771.1974666666665),
 (2785.1687999999999, 2785.2628),
 (2785.6048000000001, 2785.6487999999999),
 (2788.1061333333332, 2788.1341333333335),
 (2796.652133333333, 2796.6954666666666),
 (2829.0361333333331, 2829.0974666666666),
 (2835.7287999999999, 2835.8174666666664),
 (2846.1507999999999, 2846.2114666666666),
 (2855.2081333333331, 2855.2628),
 (2885.6867999999999, 2885.7147999999997),
 (2900.1468, 2900.2234666666668),
 (2900.6801333333333, 2900.8407999999999),
 (2915.4521333333332, 2915.5154666666667),
 (2942.6141333333335, 2942.6861333333331),
 (2944.0754666666667, 2944.1248000000001),
 (2944.1261333333332, 2944.2181333333333),
 (2944.3434666666667, 2944.3914666666665),
 (2944.5341333333331, 2944.5641333333333),
 (2946.6561333333334, 2946.7281333333331),
 (2947.3334666666665, 2947.3834666666667),
 (2953.3661333333334, 2953.4314666666664),
 (2953.8208, 2953.8601333333331),
 (2954.6048000000001, 2954.6947999999998),
 (2956.6774666666665, 2956.7654666666667),
 (3000.9261333333334, 3001.1401333333333),
 (3030.7374666666665, 3030.8214666666668),
 (3044.7461333333331, 3044.7954666666665),
 (3064.2781333333332, 3064.4414666666667),
 (3074.5088000000001, 3074.5554666666667),
 (3074.7054666666668, 3074.7854666666667),
 (3075.7034666666668, 3075.8741333333332),
 (3100.2808, 3100.3528000000001),
 (3101.2808, 3101.3221333333331),
 (3111.9934666666668, 3112.1421333333333),
 (3112.1468, 3112.1947999999998),
 (3113.2374666666665, 3113.2854666666667),
 (3133.7748000000001, 3133.8508000000002),
 (3165.4681333333333, 3165.5508),
 (3180.2748000000001, 3180.3254666666667),
 (3195.9328, 3196.0708),
 (3196.0874666666668, 3196.1454666666668),
 (3210.2428, 3210.2994666666664),
 (3217.1161333333334, 3217.1614666666665),
 (3218.8634666666667, 3218.9587999999999),
 (3221.0094666666664, 3221.0627999999997),
 (3225.2494666666666, 3225.3694666666665),
 (3237.0541333333331, 3237.1201333333333),
 (3239.2574666666665, 3239.3134666666665),
 (3256.8047999999999, 3257.0634666666665),
 (3268.4714666666669, 3268.5634666666665),
 (3272.2687999999998, 3272.3274666666666),
 (3282.7847999999999, 3282.8154666666665),
 (3306.8134666666665, 3306.8854666666666),
 (3328.1008000000002, 3328.1481333333331),
 (3353.7647999999999, 3353.8361333333332),
 (3362.8467999999998, 3362.8928000000001),
 (3389.6041333333333, 3389.7021333333332),
 (3389.7628, 3389.826133333333),
 (3389.8641333333335, 3389.9088000000002),
 (3390.9101333333333, 3391.0101333333332),
 (3425.8614666666667, 3425.9141333333332),
 (3426.0207999999998, 3426.0634666666665),
 (3426.0767999999998, 3426.1834666666664),
 (3426.7954666666665, 3426.8641333333335),
 (3427.1027999999997, 3427.1881333333331),
 (3427.6761333333334, 3427.7221333333332),
 (3428.0134666666663, 3428.1061333333332),
 (3428.1527999999998, 3428.2434666666668),
 (3445.2894666666666, 3445.3368),
 (3451.2794666666668, 3451.3254666666667),
 (3458.0081333333333, 3458.1081333333332),
 (3472.3894666666665, 3472.4548),
 (3516.2867999999999, 3516.3601333333331),
 (3530.6441333333332, 3530.7127999999998),
 (3531.6814666666664, 3531.7727999999997),
 (3531.8634666666667, 3531.942133333333),
 (3537.3594666666668, 3537.4014666666667),
 (3578.0594666666666, 3578.0994666666666),
 (3598.518133333333, 3598.5674666666664),
 (3611.6701333333331, 3611.7221333333332),
 (3611.8407999999999, 3611.9221333333335),
 (3612.9508000000001, 3612.9961333333331),
 (3628.3254666666667, 3628.3788),
 (3628.4168, 3628.5034666666666),
 (3629.4367999999999, 3629.4881333333333),
 (3629.5068000000001, 3629.6501333333331),
 (3641.7554666666665, 3641.8294666666666),
 (3641.9274666666665, 3641.9687999999996),
 (3642.4294666666665, 3642.5014666666666),
 (3653.6707999999999, 3653.7274666666667),
 (3654.8968, 3655.0541333333331),
 (3655.0668000000001, 3655.1588000000002),
 (3688.1954666666666, 3688.3001333333332),
 (3688.3047999999999, 3688.3481333333334),
 (3688.5474666666664, 3688.5907999999999),
 (3689.4501333333333, 3689.5534666666667),
 (3691.1014666666665, 3691.192133333333),
 (3721.3168000000001, 3721.3781333333332),
 (3721.4308000000001, 3721.6061333333332),
 (3721.6781333333333, 3721.7248),
 (3741.4634666666666, 3741.5381333333335),
 (3742.5414666666666, 3742.5828000000001),
 (3743.6734666666666, 3743.7401333333332),
 (3754.2921333333334, 3754.3434666666662),
 (3755.8148000000001, 3755.8701333333333),
 (3755.8754666666664, 3755.9507999999996),
 (3756.1288, 3756.1714666666667),
 (3757.8414666666667, 3757.9367999999999),
 (3774.1354666666666, 3774.2701333333334),
 (3784.3334666666665, 3784.3814666666667),
 (3784.9367999999999, 3784.9767999999999),
 (3785.6147999999998, 3785.6641333333332),
 (3800.2134666666666, 3800.2821333333331),
 (3800.3734666666669, 3800.4621333333334),
 (3814.3514666666665, 3814.4268000000002),
 (3815.0741333333335, 3815.1181333333334),
 (3815.2001333333333, 3815.3027999999999),
 (3815.3368, 3815.4207999999999),
 (3825.1181333333334, 3825.1774666666665),
 (3828.3954666666668, 3828.4841333333334),
 (3833.4007999999999, 3833.4654666666665),
 (3833.5227999999997, 3833.6487999999999),
 (3835.5261333333333, 3835.5868),
 (3835.7028, 3835.7774666666664),
 (3846.7254666666668, 3846.8407999999999),
 (3847.3514666666665, 3847.4007999999999),
 (3848.9827999999998, 3849.1214666666665),
 (3849.1881333333331, 3849.2521333333334),
 (3850.7327999999998, 3850.7828),
 (3870.6861333333331, 3870.7561333333333),
 (3870.7981333333332, 3870.8554666666669),
 (3871.3247999999999, 3871.3774666666668),
 (3876.1808000000001, 3876.2208000000001),
 (3879.9334666666664, 3880.0694666666668),
 (3881.6687999999999, 3881.7334666666666),
 (3884.4341333333332, 3884.4848000000002),
 (3886.5241333333333, 3886.5601333333334),
 (3888.5314666666663, 3888.6041333333333),
 (3890.4754666666668, 3890.5101333333332),
 (3891.0907999999999, 3891.1154666666666),
 (3892.1754666666666, 3892.2374666666665),
 (3893.5061333333333, 3893.5501333333332),
 (3903.7021333333332, 3903.7708000000002),
 (3903.9308000000001, 3903.9774666666663),
 (3904.5141333333331, 3904.5754666666667),
 (3904.9454666666666, 3905.0101333333332),
 (3905.2748000000001, 3905.4214666666667),
 (3906.4081333333334, 3906.4721333333332),
 (3906.5154666666667, 3906.5781333333334),
 (3906.9274666666665, 3906.9874666666665),
 (3907.2394666666669, 3907.4081333333334),
 (3907.9647999999997, 3908.0387999999998)]

Multitaper


In [172]:
ripple_power = ripple_detection._get_ripple_power_multitaper(CA1_lfps[0], sampling_frequency=1500)

Karlsson


In [200]:
zscored_lfp = ripple_detection._zscore(ripple_power).values.flatten()
thresholded_lfp = ripple_detection._threshold_by_zscore(ripple_power, zscore_threshold=2)
extended_lfp = ripple_detection._extend_threshold_to_mean(
                    thresholded_lfp.is_above_mean,
                    thresholded_lfp.is_above_threshold,
                    minimum_duration=0.015)

fig, axes = plt.subplots(3, figsize=(12,9), sharex=True)
candidate_ripple_start, candidate_ripple_end = list(sorted(extended_lfp))[0]

CA1_lfps[0].loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500].plot(ax=axes[0])
axes[0].axvspan(candidate_ripple_start, candidate_ripple_end, facecolor='green', alpha=0.3)

pd.DataFrame({
        'zscored_signal': zscored_lfp,
        'is_above_mean': thresholded_lfp.is_above_mean,
        'is_above_threshold': thresholded_lfp.is_above_threshold
    }).loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500].plot(ax=axes[1])
axes[1].axhline(2, color='black', linestyle=':')
axes[1].axvspan(candidate_ripple_start, candidate_ripple_end, facecolor='green', alpha=0.3)
position_df = data_processing.get_interpolated_position_dataframe(epoch_index, animals)
position_df.loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500, :].plot(y='speed', ax=axes[2])


Out[200]:
<matplotlib.axes._subplots.AxesSubplot at 0x1dd495b00>

Kay


In [203]:
ripple_power = [ripple_detection._get_ripple_power_multitaper(lfp, sampling_frequency=1500)
                for lfp in CA1_lfps]

In [213]:
combined_lfps = np.sum(pd.concat(ripple_power, axis=1) ** 2, axis=1)
zscored_combined_lfps = ripple_detection._zscore(np.sqrt(combined_lfps)).values.flatten()
smooth_combined_lfps = combined_lfps
threshold_df = ripple_detection._threshold_by_zscore(np.sqrt(smooth_combined_lfps),
                                    zscore_threshold=2)

candidate_ripple_times = list(sorted(ripple_detection._extend_threshold_to_mean(
        threshold_df.is_above_mean, threshold_df.is_above_threshold,
        minimum_duration=0.015)))

In [215]:
fig, axes = plt.subplots(5, figsize=(12,9))
candidate_ripple_start, candidate_ripple_end = candidate_ripple_times[0]

pd.concat(CA1_lfps, axis=1).loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500].plot(ax=axes[0])
axes[0].axvspan(candidate_ripple_start, candidate_ripple_end, facecolor='green', alpha=0.3)

pd.concat(ripple_power, axis=1).loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500].plot(ax=axes[1])
axes[1].axvspan(candidate_ripple_start, candidate_ripple_end, facecolor='green', alpha=0.3)

combined_lfps.loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500].plot(ax=axes[2])
axes[2].axvspan(candidate_ripple_start, candidate_ripple_end, facecolor='green', alpha=0.3)

pd.DataFrame({
        'zscored_signal': zscored_combined_lfps, 
        'is_above_mean': threshold_df.is_above_mean,
        'is_above_threshold': threshold_df.is_above_threshold
    }).loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500].plot(ax=axes[3])
axes[3].axhline(2, color='black', linestyle=':')
axes[3].axvspan(candidate_ripple_start, candidate_ripple_end, facecolor='green', alpha=0.3)
position_df = data_processing.get_interpolated_position_dataframe(epoch_index, animals)
position_df.loc[candidate_ripple_start - 0.500:candidate_ripple_start + 0.500, :].plot(y='speed', ax=axes[4])


Out[215]:
<matplotlib.axes._subplots.AxesSubplot at 0x15853a400>

Comparing Ripple Detection Methods

Compute time


In [219]:
%time ripple_times_Karlsson = ripple_detection.get_epoch_ripples(epoch_index, animals, sampling_frequency=1500, ripple_detection_function=ripple_detection.Karlsson_method)


CPU times: user 2min 10s, sys: 4.83 s, total: 2min 15s
Wall time: 2min 31s

In [221]:
%time ripple_times_Kay = ripple_detection.get_epoch_ripples(epoch_index, animals, sampling_frequency=1500, ripple_detection_function=ripple_detection.Kay_method)


CPU times: user 1min 3s, sys: 2.31 s, total: 1min 6s
Wall time: 1min 7s

In [225]:
%time ripple_times_Karlsson_multitaper = ripple_detection.get_epoch_ripples(epoch_index, animals, sampling_frequency=1500, ripple_detection_function=ripple_detection.mulititaper_Karlsson_method)


CPU times: user 2h 8min 12s, sys: 6min 8s, total: 2h 14min 21s
Wall time: 2h 29min 24s

In [273]:
%time ripple_times_Kay_multitaper = ripple_detection.get_epoch_ripples(epoch_index, animals, sampling_frequency=1500, ripple_detection_function=ripple_detection.multitaper_Kay_method)


CPU times: user 1h 57min 53s, sys: 2min 52s, total: 2h 46s
Wall time: 2h 5min 21s

Number of ripples, Average duration of ripples


In [277]:
print('Karlsson method, # of Ripples: {0}'.format(len(ripple_times_Karlsson)))
print('Kay method, # of Ripples: {0}'.format(len(ripple_times_Kay)))
print('Karlsson multitaper method, # of Ripples: {0}'.format(len(ripple_times_Karlsson_multitaper)))
print('Kay multitaper method, # of Ripples: {0}'.format(len(ripple_times_Kay_multitaper)))


Karlsson method, # of Ripples: 471
Kay method, # of Ripples: 155
Karlsson multitaper method, # of Ripples: 209
Kay multitaper method, # of Ripples: 75

In [278]:
average_duration = lambda x: np.mean(np.diff(np.asarray(x)))

print('Karlsson method, average duration (seconds): {:0.3f}'.format(average_duration(ripple_times_Karlsson)))
print('Kay method, average duration (seconds): {:0.3f}'.format(average_duration(ripple_times_Kay)))
print('Karlsson multitaper method, average duration (seconds): {:0.3f}'.format(average_duration(ripple_times_Karlsson_multitaper)))
print('Kay multitaper method, average duration (seconds): {:0.3f}'.format(average_duration(ripple_times_Kay_multitaper)))


Karlsson method, average duration (seconds): 0.069
Kay method, average duration (seconds): 0.074
Karlsson multitaper method, average duration (seconds): 0.041
Kay multitaper method, average duration (seconds): 0.055

Visualization of ripples


In [286]:
import ipywidgets

def browse_ripples(lfps, ripple_times):
    num_lfps = len(lfps)
    num_ripples = len(ripple_times)
    def plot_ripple(ripple_ind):
        fig, axes = plt.subplots(num_lfps, figsize=(num_lfps * 3, 9), sharex=True, sharey=True)
        ripple_start, ripple_end = ripple_times[ripple_ind]
        for lfp_ind, ax in enumerate(axes.flatten()):
            lfps[lfp_ind].loc[ripple_start - .5:ripple_start + .5].plot(ax=ax)
            ax.axvspan(ripple_start, ripple_end, facecolor='green', alpha=0.3)
        plt.suptitle('Ripple #{:d} ({:0.3f}, {:0.3f})'.format(ripple_ind+1, ripple_start, ripple_end), fontsize=18)
    ipywidgets.interact(plot_ripple, ripple_ind=ipywidgets.IntSlider(value=0, min=0, max=num_ripples-1, continuous_update=False))

In [287]:
browse_ripples(CA1_lfps, ripple_times_Karlsson)



In [288]:
browse_ripples(CA1_lfps, ripple_times_Kay)



In [289]:
browse_ripples(CA1_lfps, ripple_times_Karlsson_multitaper)



In [290]:
browse_ripples(CA1_lfps, ripple_times_Kay_multitaper)


Compare times


In [296]:
fig, axes = plt.subplots(4, figsize=(12,9), sharex=True)
time_extent = CA1_lfps[0].index.min(), CA1_lfps[0].index.max()

for ripple_start, ripple_end in ripple_times_Karlsson:
    axes[0].axvspan(ripple_start, ripple_end, facecolor='green', alpha=0.3)
axes[0].set_title('Karlsson')
axes[0].set_xlim(time_extent)


for ripple_start, ripple_end in ripple_times_Kay:
    axes[1].axvspan(ripple_start, ripple_end, facecolor='red', alpha=0.3)
axes[1].set_title('Kay')
axes[1].set_xlim(time_extent)

for ripple_start, ripple_end in ripple_times_Karlsson_multitaper:
    axes[2].axvspan(ripple_start, ripple_end, facecolor='orange', alpha=0.3)
axes[2].set_title('Karlsson-Multitaper')
axes[2].set_xlim(time_extent)

for ripple_start, ripple_end in ripple_times_Kay_multitaper:
    axes[3].axvspan(ripple_start, ripple_end, facecolor='purple', alpha=0.3)
axes[3].set_title('Kay-Multitaper')
axes[3].set_xlim(time_extent)

axes[3].set_xlabel('Time (seconds)')


Out[296]:
<matplotlib.text.Text at 0x1e9f71ac8>

In [ ]: